This error is executed strictly following the examples found in the documents . And you cannot find any clarification about this anywhere, be it this long docs , google or stackoverflow page . Also, reading optparse.py shows that OptionGroup exists, which adds to the confusion.
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) >>> from optparse import OptionParser >>> outputGroup = OptionGroup(parser, 'Output handling') Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'OptionGroup' is not defined
I bet it would take less than a minute for someone to find my mistake. :)
Yes, this means that I knew the answer, but since it took me so long to find that I wanted to "document" it here.
source share