我在新的python3.4.3上运行这个跟踪路由模块时遇到了问题。在python的早期版本中,我能够运行该模块,但现在我无法运行。当我尝试调用optparse的parser.error()
函数时,我一直收到这个回溯错误。在
TypeError: error() missing 1 required positional argument: 'msg'*
这是我的代码片段
^{pr2}$错误总是出现在“if”语句中
if len(args) != 1:
parser.error()
然后我试了这个
if len(args) != 1:
parser.error("Incorrect number of arguments")
当我这次尝试运行模块时,我收到了这个错误
Usage: TraceRoute.py [options] hostname TraceRoute.py: error: Incorrect number of arguments
我希望得到一些关于如何修复此代码以防止此错误的反馈,以及关于如何在Python3.4.3中正确使用optparse库的更多信息
目前没有回答
相关问题 更多 >
编程相关推荐