python - How to use multiple wxPython project files in one program? -
i trying make pretty big app many different parts , windows. decided lot cleaner if had windows have own file , import them main file. tried when try run class, gives error of needing 3 arguments. not understand how should go doing appreciated! main file:
import wx import login login.apples(self,parent,id) class oranges(wx.frame): def __init__(self,parent, id): wx.frame.__init__(self,parent,id,"mail",size=(700,700)) self.frame=wx.panel(self) if __name__=="__main__": app=wx.app(false) window=oranges(parent=none, id=-1) window.show() app.mainloop()
i nameerror: name "self" not defined.
import wx class apples(wx.frame): def __init__(self,parent,id): wx.frame.__init__(self,parent,id,"login mail",size=(400,400)) self.frame=wx.frame(self) if __name__=="__main__": app=wx.app(false) window=apples(parent=none, id=-1) window.show() app.mainloop()
import wx import login #login.apples(self,parent,id) #this line wont work ... there no self here... #see below in if __name__ == "__main__" part class oranges(wx.frame): def __init__(self,parent, id): wx.frame.__init__(self,parent,id,"mail",size=(700,700)) self.frame=wx.panel(self) if __name__=="__main__": app=wx.app(false) window=oranges(parent=none, id=-1) other_window = login.apples(parent=none,id=-1) window.show() other_window.show() app.mainloop()
Comments
Post a Comment