6

我已wxpython成功安装,我已通过以下方式验证

import wx

但是当我写代码时

import wx
class gui(wx.Frame):
    def __init__(self,parent,id):
        wx.Frame.__init__(self, parent,id,'Visualisation for Telecom Customer Data', size = (300,200))

if __name__ =='__main__':
    app = wx.PySimpleApp()
    frame = gui(parent = None, id = -1)
    frame.show()
    app.MainLoop()

它显示错误

Traceback (most recent call last):
  File "D:\Bishnu\BE\4th year\7th semester\Major Project I\Workspace\Wxpython\default\GUI.py", line 13, in <module>
    frame.show()
AttributeError: 'gui' object has no attribute 'show'

可能是什么解决方案?

4

1 回答 1

7

利用

frame.Show() 

代替

frame.show()

在python中都区分大小写

于 2013-04-26T07:30:47.677 回答