[Tutor] argparse iterable

Mark Lawrence breamoreboy at yahoo.co.uk
Tue Apr 2 04:34:26 CEST 2013


On 02/04/2013 02:37, Dave Angel wrote:
> On 04/01/2013 09:31 PM, Mark Lawrence wrote:
>>
>> for a in vars(parser.parse_args()):
>>      print('This arg is %s' % a)
>>
>> http://docs.python.org/3/library/argparse.html#the-namespace-object
>>
>> Please don't ask me for an explanation as it took me long enough to work
>> this out from the docs :)
>>
>
> http://docs.python.org/2/library/argparse.html
>
>      see section 15.4.4.6 for a very brief explanation of vars()
>
>

Section 15.4.4.6. The Namespace object, but I can't for the life of me 
remember what my link referred to :)

-- 
If you're using GoogleCrap™ please read this 
http://wiki.python.org/moin/GoogleGroupsPython.

Mark Lawrence



More information about the Tutor mailing list