Re: Help me debug this script with argparse and if statements

2013-02-21 Thread Chris Angelico
On Thu, Feb 21, 2013 at 9:56 PM, Santosh Kumar wrote: >> To do what you're looking for there, I wouldn't bother with argparse >> at all - I'd just look at sys.argv[1] for the word you're looking for. >> Yes, it'd be a bit strict and simplistic, but by the look of things, >> you don't need sophisti

Re: Help me debug this script with argparse and if statements

2013-02-21 Thread Santosh Kumar
> To do what you're looking for there, I wouldn't bother with argparse > at all - I'd just look at sys.argv[1] for the word you're looking for. > Yes, it'd be a bit strict and simplistic, but by the look of things, > you don't need sophistication. You are right, but I think sys.argv is very basic.

Re: Help me debug this script with argparse and if statements

2013-02-21 Thread Peter Otten
Chris Angelico wrote: > On Thu, Feb 21, 2013 at 9:05 PM, Santosh Kumar > wrote: >> parser.add_argument( >> 'install', >> nargs='?', >> help='install myapp' >> ) >> >> parser.add_argument( >> 'uninstall', >> nargs='?', >> help='uninstall myapp' >> ) >> >> args = par

Re: Help me debug this script with argparse and if statements

2013-02-21 Thread Chris Angelico
On Thu, Feb 21, 2013 at 9:05 PM, Santosh Kumar wrote: > parser.add_argument( > 'install', > nargs='?', > help='install myapp' > ) > > parser.add_argument( > 'uninstall', > nargs='?', > help='uninstall myapp' > ) > > args = parser.parse_args() What you've done is ma