我在 Windows 上使用 python。我正在尝试找到一种在启动 python 时导入一些默认模块的方法。这意味着,当启动python时,一些模块应该已经导入,就像builtins。有什么办法吗?
Thanks.
如果您的意思是进入交互模式,只需制作一个小的启动脚本即可。而不是仅仅使用以下命令启动 python:
python
尝试改为:
python -i startupImports.py
启动导入.py:
import time
from collections import defaultdict
from customclass import myclass
#...etc
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)