How to save the output of an IPython console to a file in Spyder?

牧云@^-^@ 提交于 2019-11-30 14:36:39

Very interesting question! Fortunately IPython has the right magic for you. It's called %logstart (please follow the link for the full documentation).

To start using it and save the input and output of all your commands, just type in an IPython console

In[1]: %logstart -o

and that will record your session from that moment on into a file called ipython_log.py placed in your current directory.

%logstart is very flexible, so you can select a different file to save to, and also how you save your session (either pure Python or as IPython commands).

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