【发布时间】:2020-11-16 13:30:39
【问题描述】:
我想运行一个脚本,它会进行一些设置,然后在该环境中打开一个 shell。所以与其做
$ python
>>> # do some setup
>>> # start doing what I really came here to do
我想做
$ python my_script.py
>>> # start doing what I really came here to do
【问题讨论】:
-
你可以编写文件,然后在shell中输入
from filename import *。 -
这能回答你的问题吗? stackoverflow.com/questions/22163422/…
-
@gmdev 也许,但到目前为止我的答案是简洁和相关的
标签: python