Auto-Loading a module on IPython startup

后端 未结 1 1514
青春惊慌失措
青春惊慌失措 2020-12-06 06:17

I\'m trying to to auto load the division module from __future__ on startup, i\'ve currently got a simple script in the IPython startup libray with

相关标签:
1条回答
  • 2020-12-06 06:36

    i've found a solution to this one, in your IPython profile directory (by default - .ipython\profile_default), edit the file ipython_config.py (create it with ipython profile create if it does not exist) with the following lines:

    # loads the root config object
    c=get_config()
    
    # executes the line in brackets on program launch
    c.InteractiveShellApp.exec_lines = ['from __future__ import division']
    
    0 讨论(0)
提交回复
热议问题