Skip to main content
 首页 » 编程设计

python之我越来越需要多个值来解压值错误

2025年05月04日25zhenyulu

<分区>

这是我的程序

from sys import argv 
script, first, second, third = argv 
print ("the script is:", script) 
print("the first variable is:", first) 
print("the second variable is:", second) 
print ("the third variable is:", third) 

错误是:

Traceback (most recent call last): 
  File "C:/Users/ravikishore/PycharmProjects/Test/.idea/MyPython.py", line 2, in <module> 
    [script, first, second, third] = argv 
ValueError: need more than 1 value to unpack