Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #43048 > unrolled thread

help needed

Started byleonardo selmi <l.selmi@icloud.com>
First post2013-04-08 10:01 +0200
Last post2013-04-08 10:01 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  help needed leonardo selmi <l.selmi@icloud.com> - 2013-04-08 10:01 +0200

#43048 — help needed

Fromleonardo selmi <l.selmi@icloud.com>
Date2013-04-08 10:01 +0200
Subjecthelp needed
Message-ID<mailman.274.1365411757.3114.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web