On Thursday 16 June 2011 19:03:27 Joel Goldstick wrote: > On Thu, Jun 16, 2011 at 1:10 PM, Lisi <lisi.re...@gmail.com> wrote: > > Copied and pasted: > > >From text of Learn Python the Hard Way > > > > 1 from sys import argv > > 2 > > 3 script, user_name = argv > > > > >From my script (typed, not copied and pasted, but copied and pasted from > > > > my > > script to here): > > > > 1 from sys import argv > > 2 > > 3 script, user_name = argv > > > > I have tried every permutation of white space I could think of that might > > have > > looked like the original, but I always get the same error: > > > > lisi@Tux:~/Python/LearnPythonTheHardWay$ python ex14.py > > Traceback (most recent call last): > > File "ex14.py", line 3, in <module> > > script, user_name=argv > > ValueError: need more than 1 value to unpack > > > > I haven't got past line 3 yet!! I know that you need the right number of > > variables, but my script has got as many as the original - it's the same > > as the original!
> when you run the program you are not giving it any arguments to read. > argv[0] is the name of your script. But you are not providing a value for > user_name to consume > > Try this: > > lisi@Tux:~/Python/LearnPythonTheHardWay$ python ex14.py Lisi Thanks to all of you, guys. :-)) So it wasn't the script that was wrong, it was the command I was giving. Doh! It now runs fine as far as I have gone, so I can now finish typing the rest of the script in. Hopefully without too many stupid mistakes. :-( Lisi _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor