问题
I am currently working in an IPython Notebook. I am running a function across different engines and would like to see what it prints.
Example:
def simple(a):
print a+40;
return a+20
A = range(20);
dview.map_sync(simple, A);
I would like this functionality because I'm running a function that runs for a long time and I am using print
statements to keep track of its progress.
来源:https://stackoverflow.com/questions/16430827/printing-to-main-stdout-in-ipython-notebook-from-other-parallel-engines