[Tutor] optparse example

Tasos Latsas tlatsas2000 at gmail.com
Mon Sep 22 16:16:48 CEST 2008

Hello list,
I tried the optparse example from the python library reference and it
doesn't seem to work..what am I doing wrong?
I keep getting the "incorrect number of arguments" message although i
use the correct number..

The example is here :

if i edit the code and write:
print parser.parse_args()

I get:
(<Values at 0xb7d3b9ec: {'verbose': False, 'filename': None}>, [])

as you can see the argument list is empty
I run the program as ./parser.py -q
(i also tried 'python parser.py -q' but didnt help)

Thank you in advance

More information about the Tutor mailing list