python – 未定义名称“OptionGroup”
作者:互联网
此错误严格按照examples found on the docs进行.您无法在任何地方找到任何有关它的说明,无论是that long long docs page,google还是stackoverflow.另外,阅读optparse.py会显示OptionGroup,因此会增加混乱.
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
我敢打赌,有人发现我的错误不到1分钟.
标签:python,optparse,nameerror 来源: https://codeday.me/bug/20190606/1190831.html