Print not showing in ipython notebook

后端 未结 3 2010
误落风尘
误落风尘 2020-12-04 16:37

I am using ipython notebook (http://ipython.org/notebook.html) to do a demo and it seems like the print function is not working:

3条回答
  •  春和景丽
    2020-12-04 17:19

    I encountered a similar problem (the reload(sys) was in a package I imported).

    My workaround was that at the top of the script, I import sys, and store sys.stdout in a separate variable, e.g. stdout.

    Then I import all the other stuff, including the one that calls reload(sys).

    Then, at the end, I set sys.stdout = stdout, which redirects the output back to the IPython notebook

提交回复
热议问题