I have a script, this call to a wx.app
when I close the wx.app this close the script, why ?
class Frame(wx.Frame):
def _init_ctrls(self, prnt):
...
class BoaApp(wx.App):
def OnInit(self):
self.main = Frame.create(None)
self.main.Show()
self.SetTopWindow(self.main)
return True
def main():
application = BoaApp(0)
application.MainLoop()
if __name__ == '__main__':
main()
When you call
app.MainLoop()the script goes into a loop which runs the app. When you close the app the loop exits and any code after the call ofapp.MainLoop()then executes. If there isn’t anything left to do, the script will end.