小编J A*_*J A的帖子

如何在argv中使用raw_input?

我正在从Learn Python The Hard Way做ex13

我正试图通过:

python ex13.py raw_input() raw_input() raw_input()
Run Code Online (Sandbox Code Playgroud)

我的代码如下:

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 "ex13.py", line 5, in <module>
   script, first, second, third = argv
ValueError: too many values to unpack
Run Code Online (Sandbox Code Playgroud)

我想知道为什么我会收到此错误以及如何解决此问题

python raw-input argv

4
推荐指数
2
解决办法
1万
查看次数

标签 统计

argv ×1

python ×1

raw-input ×1