Zac*_*iro 6 python argv command-line-arguments
我目前正在学习Python的艰难之路.我想这个例子可能已经过时了,所以我想在这里得到反馈.
我正在使用Python 3.1
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))
Run Code Online (Sandbox Code Playgroud)
我收到这个错误:
Traceback (most recent call last):
File "/path/ch13.py", line 3, in <module>
script, first, second, third, bacon = argv
ValueError: need more than 1 value to unpack
Run Code Online (Sandbox Code Playgroud)
知道什么是错的吗?
归档时间: |
|
查看次数: |
21337 次 |
最近记录: |