关于“来自sys import argv”的事情

时间:2016-07-14 09:44:16

标签: python

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)

我使用PyCharm来运行我的代码,但是得到了这个错误:

Traceback (most recent call last):
  File "C:/Users/Administrator/Desktop/haha.py", line 3, in <module>
    script, first, second, third = argv
ValueError: not enough values to unpack (expected 4, got 1)

0 个答案:

没有答案