PythonCall.jl
PythonCall.jl copied to clipboard
IPython redirect stdout
We used to set Base.stdout to PyIO(sys.stdout) but this causes bugs so is removed.
Instead copy the IJulia approach: use pipe = redirect_stdout() and have an async task watch the pipe for output and write it to sys.stdout.
What PyCall does is to set sys.stdout to Base.stdout and it seems to work fine.
I recently also updated PyCall to install a post-execute hook to flush Python stdio after each cell is executed in IJulia.
But maybe you are talking about JuliaCall from IPython here, not PythonCall from IJulia?
Yeah exactly, this ticket is about the other side (using JuliaCall from IPython).