PYTHONSTARTUP
If this is the name of a readable file, the Python commands
in that file are executed before the first prompt is displayed
in interactive mode. The file is executed in the same namespace
where interactive commands are executed so that objects defined
or imported in it can be used without qualification in the interactive
session. You can also change the prompts sys.ps1 and sys.ps2 in this file.
将其放入文件
.pythonrc
(可以通过环境变量PYTHONSTARTUP
控制该文件的名称)。阅读有关here的更多信息:另请参见:
相关问题 更多 >
编程相关推荐