我找到了一个解决方案,在您的IPython配置文件目录(默认为-.ipython\profile_default
)中,使用以下几行来编辑文件ipython_config.py
(ipython profile create
如果不存在,请创建文件):
# loads the root config object
c=get_config()
# executes the line in brackets on program launch
c.InteractiveShellApp.exec_lines = ['from __future__ import division']