The beginning of the use of wxPython, there is a problem

#!/usr/bin/python
import wx
###################
#Note: this program
#has a problem
###################
class MyFrame(wx.Frame):
def __init(self, parent = None, id = -1 , title = 'My Frame' ,
pos =wx.DefaultPosition , size=(300, 300)):
#wx.Frame.__init__(self,None,-1,"My Frame",size=(300,300))
wx.Frame.__init__(self,parent, id, title,pos,size)
panel = wx.Panel(self,-1)
panel.Bind(wx.EVT_MOTION,self.OnMove)
wx.StaticText(panel,-1,"Pos:",pos=(10,12))
self.posCtrl = wx.TextCtrl(panel,-1,"",pos=(40,10))
def OnMove(self,event):
pos = event.GetPosition()
self.posCtrl.SetValue("%s,%s"%(pos.x,pos.y))

if __name__ =='__main__':
app = wx.PySimpleApp()
frame = MyFrame()#This is the twenty-second line
frame.Show(True)
app.MainLoop()



Always wrong:
TypeError: Required argument 'parent' (pos 1) not found
File "/home/wang/wxpy2.py", line 22, in <module>
frame = MyFrame()
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_windows.py", line 497, in __init__
_windows_.Frame_swiginit(self,_windows_.new_Frame(*args, **kwargs))

Started by Sonia at January 05, 2017 - 6:36 PM

The initialization function name custom error:
def __init__(...

Posted by Todd at January 12, 2017 - 6:15 PM

Thank you, careless

Posted by Sonia at January 12, 2017 - 7:46 PM

__init__

Posted by Alan at January 14, 2017 - 6:50 PM