iPython - set up magic commands in configuration file

自作多情 提交于 2019-12-05 03:47:45

Execute magics as follows:

get_ipython().magic(u"%reload_ext autoreload")
get_ipython().magic(u"%autoreload 2")

You can put those lines in your startup script here:

~/.ipython/profile_default/startup/00-first.py

To start for example the %pylab magic command on startup do the following:

ipython profile create pylab

Add the following code to your .ipython\profile_pylab\ipython_config.py

c.InteractiveShellApp.exec_lines = ['%pylab']

and start ipython

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