【发布时间】:2013-08-11 22:29:50
【问题描述】:
我想知道 Python 脚本是否可以在运行时启动 Python 解释器,从而使变量可以从解释器中访问。
让我解释一下。假设我有以下脚本:
x = 20
LaunchInterpreter() #Imaginary way to launch the Interpreter
现在,解释器启动了,我们可以使用变量了。
>>> x #x defined value by the script
20
>>> x*x
400
【问题讨论】:
-
在这里查看第一个答案:stackoverflow.com/questions/11796474/…
-
这完全符合我的要求,谢谢!
标签: python