help needed

leonardo selmi l.selmi at icloud.com
Mon Apr 8 04:01:57 EDT 2013


hello all,

i have typed the following program from the book "learn python the hard way":

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
then i get this error:

Traceback (most recent call last):
  File "/Users/leonardo/Documents/ex13.py", line 3, in <module>
    script, first, second, third = argv
ValueError: need more than 1 value to unpack

in the book the author says that i should run the program like this:

$ python ex13.py first 2nd 3rd
The script is called: ex13.py
Your first variable is: first
Your second variable is: 2nd
Your third variable is: 3rd
but how can i do that?? what are the steps? where should i go?
thanks!

best regards
leonardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130408/7a307b82/attachment.html>


More information about the Python-list mailing list