How do I print useful errors with getopt?

gradha at iname.com gradha at iname.com
Sun Jan 7 05:09:17 EST 2001


Hi.

Coming from the C world, I got a try at the python getopt module. It works
nicely, but there are is something I miss: when the user supplies a wrong
switch combination, I miss getopt reporting the specific error. I can of
course catch getopt.error, but how can I print to the user what triggered
the error? Under C it was as easy as not touching opterr: the system would
then print the conflict in the appropiate localized text.

I am running Debian Potato with Python 1.5.2, if it's of any use to you.

-- 

 Grzegorz Adam Hankiewicz   gradha at iname.com - http://gradha.infierno.org
 Other web pages:  http://glub.ehu.es/  -  http://welcome.to/gogosoftware/



More information about the Python-list mailing list