在python启动时自动加载模块

在python启动时自动加载模块

问题描述:

我希望IPython或Python解释器在启动时自动加载模块。

I want IPython or the Python interpreter to auto-load a module when I start them.

有可能吗?

例如,当我启动IPython时:

For example when I start IPython:

$ ipython

...

>>> from __future__ import division
>>> from mymodule import *

In [1]:

SymPy的实时shell

检查文件〜/ .ipython / ipythonrc - 您可以列出要加载的所有模块启动。

Check the file ~/.ipython/ipythonrc - you can list all modules you want to load at the startup.