coding utf-8 import wx class MainFrame wx Frame def __init__ self pare

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- coding: utf-8 -*-
import wx
class MainFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, -1, 'Example', style=wx.CAPTION | wx.MINIMIZE_BOX | wx.CLOSE_BOX | wx.SYSTEM_MENU)
self.SetSize((300, 300))
self.Centre()
class Example(wx.App):
def OnInit(self):
frame = MainFrame(None)
frame.Show()
return True
def main():
application = Example()
application.MainLoop()
if __name__ == '__main__':
main()
#####################################################
>>>
Traceback (most recent call last):
File "C:\temp\wx.py", line 3, in <module>
import wx
File "C:\temp\wx.py", line 5, in <module>
class MainFrame(wx.Frame):
AttributeError: 'module' object has no attribute 'Frame'
>>>