So, I don't understand how 'self' is never defined, but it's always used.
Ex:
def __init__(self,parent,id):
wx.Frame.__init__(self,parent,id,"My Frame",size=(300,200))
panel=wx.Panel(self)
self=self.CreateStatusBar()
menu=CreateMenuBar()
first=wx.Menu()
first.Append(NewId(),"Close window","Yup")
menu.Append(first,"File")
I'm not sure if this is correct, and I'm still working out the bugs, and this is just part of the script, but howcome you don't define self
? You can just go self.CreateStatusBar()
. How does Python know what self
is? Please explain in simple words.
Thanks! :)