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
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
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
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
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