在python启动时自动加载模块 [英] Auto-load a module on python startup

查看:214
本文介绍了在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.

这篇关于在python启动时自动加载模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆