在看Learn Python The Hard Way
有一章的代码是这样的:
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
结果用自带的IDLE运行的时候总是说:
Traceback (most recent call last):
File "C:/Python27/13.py", line 3, in <module>
script, first, second, third = argv
ValueError: need more than 1 value to unpack
然后用cmd或者powershell运行时总是说:
python.exe: can't open file '13.py':[Errno 2] No such file or directory
求解释。。。在这卡半天了。。
有一章的代码是这样的:
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
结果用自带的IDLE运行的时候总是说:
Traceback (most recent call last):
File "C:/Python27/13.py", line 3, in <module>
script, first, second, third = argv
ValueError: need more than 1 value to unpack
然后用cmd或者powershell运行时总是说:
python.exe: can't open file '13.py':[Errno 2] No such file or directory
求解释。。。在这卡半天了。。