def insureWxApp():
    """Create an instance of PySimpleApp if there is no app already.
    This is required by wxPython before creating any GUI objects.
    """
    global _wxApp
    _wxApp = wx.GetApp()
    if not _wxApp:
        _wxApp = wx.PySimpleApp()
    return _wxApp
Create an instance of PySimpleApp if there is no app already.
    This is required by wxPython before creating any GUI objects.
    
recipes/Python/496868_Easily_creating_dialog_boxes_XRC/recipe-496868.py