【发布时间】:2015-12-16 22:10:20
【问题描述】:
我运行这段代码:
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
但是当我运行它时,我得到了这个错误:
ValueError: need more than 1 value to unpack
【问题讨论】:
-
看来argv只有一个值。你执行了
python yourscript而不是python yourscript a b c
标签: python python-2.x