相关疑难解决方法(0)

在Python中调用外部命令

如何在Python脚本中调用外部命令(就像我在Unix shell或Windows命令提示符下键入它一样)?

python shell terminal command subprocess

4553
推荐指数
57
解决办法
325万
查看次数

如何在Spyder中使用argv

我在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)

python spyder

12
推荐指数
4
解决办法
4万
查看次数

标签 统计

python ×2

command ×1

shell ×1

spyder ×1

subprocess ×1

terminal ×1