Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ValueError:太多值无法解压缩Aptana Studio 3_Python_Aptana - Fatal编程技术网

Python ValueError:太多值无法解压缩Aptana Studio 3

Python ValueError:太多值无法解压缩Aptana Studio 3,python,aptana,Python,Aptana,我正在学习learnpythonthehardway.org上的练习13。我应该运行以下代码: 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

我正在学习learnpythonthehardway.org上的练习13。我应该运行以下代码:

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
然后在命令行中输入“python ex13.py first-second-3rd”,并应输出:

The script is called: ex13.py
Your first variable is: first
Your second variable is: 2nd
Your third variable is: 3rd 
然而,我在Vista上使用Aptana Studio 3,我得到了 “ValueError:要解包的值太多”错误

我不熟悉Python和Aptana,因此如何在这里输入单独的参数

这是因为
len(argv)
可能大于4:

>>> w,x,y,z=[1,2,3,4,5]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: too many values to unpack
w,x,y,z=[1,2,3,4,5] 回溯(最近一次呼叫最后一次): 文件“”,第1行,在 ValueError:要解压缩的值太多
尝试打印
argv
以查看
argv
实际包含的内容。

在脚本窗口中,右键单击,显示>终端。它将在Aptana中打开一个终端窗口。然后键入python'yourscript'.py
我想这会按照你想要的方式运行;您可以使用
脚本,first、second、third=argv[:4]
但我怀疑还有其他问题,可能是文件路径带有空格no。我在输入这些论点时遇到困难。在练习中,我们应该在终端上输入ex13.py first 2nd 3rd,但由于Aptana没有终端,我如何调整此代码?我应该输入参数吗?first、2nd和3rd的值是多少?@GTyler使用
raw_input()
,从用户输入中获取值。
first=raw_input('enter the value of first'))
second
=
原始输入(“输入second的值”)
ans以此类推。。