IPython notebook shows output in terminal

旧时模样 提交于 2019-12-12 10:48:51

问题


I'm using an IPython notebook (ipython notebook &), but when I try to print something to get any output by simply giving the variable name ans pressing Shift + Enter, instead of getting the output in notebook (next to the cell), I get it in the terminal from where I launch the notebook. I want to see the output in the notebook itself, next to the concerned cell. I'm facing this problem lately, previously it was working fine.


回答1:


This code produces the same issue on my machine:

import sys  
reload(sys)  
sys.setdefaultencoding('utf8')

After running that in a cell, or importing a module which runs that piece of code, all output ends up in the terminal instead of the notebook.



来源:https://stackoverflow.com/questions/23306893/ipython-notebook-shows-output-in-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!