IPython startup customization

前端 未结 1 552
忘了有多久
忘了有多久 2021-02-07 07:51

I am trying to load things like from __future__ import division on the IPython startup on windows 7 64 bit machine, python 2.7 64 bit.

相关标签:
1条回答
  • 2021-02-07 08:09

    Check to see if C:\Users\Me\.ipython\profile_default\ipython_config.py exists. If it doesn't, run

    ipython profile create
    

    from the command line to generate it. Next, open it in your favorite text editor and search for c.InteractiveShellApp.exec_lines. Uncomment that line (it's line 27 in my file) and edit it to be the following:

    c.InteractiveShellApp.exec_lines = ["from __future__ import division", "from __future__ import unicode_literals"]
    

    Save the file, restart IPython, and you should be all set.

    0 讨论(0)
提交回复
热议问题