python运行报错,请高手解答,谢谢
运行这个程序报错importwxclassApp(wx.App):defOnInit(self):frame=wx.Frame(parent=None,title='Ba...
运行这个程序报错
import wx
class App(wx.App):
def OnInit(self):
frame=wx.Frame(parent=None,title='Bare')
frame.Show()
return True
app=App()
app.MainLoop()
错误信息如下:
> "D:\Python27\python.exe" -u "D:\py\bare.py"
hello world
Traceback (most recent call last):
File "D:\py\bare.py", line 1, in <module>
import wx
File "D:\Python27\lib\site-packages\wx-2.9.5-msw\wx\__init__.py", line 45, in <module>
from wx._core import *
File "D:\Python27\lib\site-packages\wx-2.9.5-msw\wx\_core.py", line 6, in <module>
new_instancemethod = new.instancemethod
AttributeError: 'module' object has no attribute 'instancemethod'
答案已经找到了,在工作目录中有关键字命名的文件,才会报错。 展开
import wx
class App(wx.App):
def OnInit(self):
frame=wx.Frame(parent=None,title='Bare')
frame.Show()
return True
app=App()
app.MainLoop()
错误信息如下:
> "D:\Python27\python.exe" -u "D:\py\bare.py"
hello world
Traceback (most recent call last):
File "D:\py\bare.py", line 1, in <module>
import wx
File "D:\Python27\lib\site-packages\wx-2.9.5-msw\wx\__init__.py", line 45, in <module>
from wx._core import *
File "D:\Python27\lib\site-packages\wx-2.9.5-msw\wx\_core.py", line 6, in <module>
new_instancemethod = new.instancemethod
AttributeError: 'module' object has no attribute 'instancemethod'
答案已经找到了,在工作目录中有关键字命名的文件,才会报错。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询