Re: [Tutor] Beginner puzzle with unpacking argv

2011-06-16 Thread Lisi
On Thursday 16 June 2011 19:03:27 Joel Goldstick wrote: > On Thu, Jun 16, 2011 at 1:10 PM, Lisi 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 c

Re: [Tutor] Beginner puzzle with unpacking argv

2011-06-16 Thread Peter Lavelle
If you need to process command line arguments then the argparse module may also be useful to you. More info can be found here: http://docs.python.org/library/argparse.html Regards Peter Lavelle On 16/06/11 19:03, Steve Willoughby wrote: On 16-Jun-11 10:10, Lisi wrote: 1 from sys import arg

Re: [Tutor] Beginner puzzle with unpacking argv

2011-06-16 Thread Joel Goldstick
On Thu, Jun 16, 2011 at 1:10 PM, Lisi 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

Re: [Tutor] Beginner puzzle with unpacking argv

2011-06-16 Thread Steve Willoughby
On 16-Jun-11 10:10, Lisi wrote: 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: That will work ONLY if argv has at least 2 values in it. Your source

[Tutor] Beginner puzzle with unpacking argv

2011-06-16 Thread Lisi
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 wh