如何在Python脚本中调用外部命令(就像我在Unix shell或Windows命令提示符下键入它一样)?
我在Spyder中运行下面的代码.我在py文件中输入了它,只需点击运行按钮即可.
当我尝试运行它时,我收到错误:
ValueError:需要多于1个值才能解压缩
如图所示,你打算在运行程序之前给出argv变量的输入,但我不知道如何做到这一点是spyder?
http://learnpythonthehardway.org/book/ex13.html
from sys import argv
script, first, second, third = argv
print "The script is called:", script
print "The first variable is:", first
print "The second variable is:", second
print "Your third variable is:", third
Run Code Online (Sandbox Code Playgroud)