def get_app_wx(*args, **kwargs):
 import wx
 app = wx.GetApp()
 if (app is None):
  if ('redirect' not in kwargs):
   kwargs['redirect'] = False
  app = wx.PySimpleApp(*args, **kwargs)
 return app

def get_app_wx ( * args , ** kwargs ) : import wx app = wx . GetApp ( ) if ( app is None ) : if ( 'redirect' not in kwargs ) : kwargs [ 'redirect' ] = False app = wx . PySimpleApp ( * args , ** kwargs ) return app
create a new wx app or return an exiting one .