Message125834
In section "14.4.3.6. type" of the argparse module, the following code sample is given:
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('foo', type=int)
>>> parser.add_argument('bar', type=file)
>>> parser.parse_args('2 temp.txt'.split())
Namespace(bar=<open file 'temp.txt', mode 'r' at 0x...>, foo=2)
The built-in "file" used for argument 'bar' no longer exists in python 3.2. |
|
Date |
User |
Action |
Args |
2011-01-09 09:07:41 | blep | set | recipients:
+ blep, docs@python |
2011-01-09 09:07:40 | blep | set | messageid: <1294564060.95.0.807361745459.issue10871@psf.upfronthosting.co.za> |
2011-01-09 09:07:39 | blep | link | issue10871 messages |
2011-01-09 09:07:39 | blep | create | |
|