我如何在Spyder控制台中执行Python 3.3脚本,并且有变量?如何在Spyder控制台中使用变量执行Python 3.3脚本?
我的示例代码(C:/test/myfile.py)是
from sys import argv
script, first, second, third = argv
print("The script is called:", script)
print("Your first variable is:", first)
print("Your second variable is:", second)
print("Your third variable is:", third)
我曾尝试EXEC: - 和(开放( “C:\测试\ myfile.py”)阅读())。我得到的错误是“ValueError:需要超过1个值才能解包,我想先提供变量=”1st“,second =”2nd“,third =”3rd“,我怎么写exec()它能够处理输入
我使用Python 3.3,64位安装,Windows操作系统,安装:?WinPython
你的意思是这样的:http://stackoverflow.com/questions/89228/calling-an-external-command-in-蟒蛇/ 89243#89243 – User