Hi, I finding difficult to execute this program. The wx.Notebook i created is coming on the splitted frame(self.p2). How do I that. I am started to learn wxPython, and when I run the code, the code doesnot close gracefully, it throughs me an error.

"pythonw.exe has encountered a problem and needs to close. We are sorry for the inconvenience"

I clicked for more information, then I got the error message which I have attached it in text file. Please help me out with this problem.

here is the code.... seems a bit lengthy, sorry about that.
Please help me to find my mistake, and how do I go forward resolving this problem.

import wx

ID_ADD_NEW = 5001
ID_DEACTIVATE = 5002
ID_EXIT = 5003

class _AddNewFund(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
        box=wx.StaticBox(self, -1, "Add New Fund")
        boxsizer=wx.StaticBoxSizer(box, wx.HORIZONTAL)
        
        t=wx.StaticText(self, -1, "Please select an Excel file to upload new funds.", (20,20))
        boxsizer.Add(t, 0, wx.TOP|wx.LEFT, 10)
        t=wx.StaticText(self, -1, "This is page one content2", (20,40))
        boxsizer.Add(t, 0, wx.TOP|wx.LEFT, 10)

        self.text1=wx.TextCtrl(self, -1, "")
        
        b1 = wx.Button(self, 10, " Browse ")
        b2 = wx.Button(self, 10, " Upload ", (60, 20))
        self.Bind(wx.EVT_BUTTON, self.OnBrowse, b1)
        self.Bind(wx.EVT_BUTTON, self.OnUpload, b2)
        b1.SetDefault()
        b1.SetSize(b1.GetBestSize())
        b2.SetSize(b2.GetBestSize())
        
        grid1=wx.FlexGridSizer(0,2,0,0)
        grid1.Add( self.text1, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
        grid1.Add( b1, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
        #grid1.Add( b2, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
        border=wx.BoxSizer()
        border.Add(boxsizer, 1, wx.EXPAND)
        self.SetSizer(border)
        boxsizer.Add(grid1, 0, wx.ALIGN_CENTRE)
        border.Add(boxsizer, 0, wx.ALIGN_CENTRE)
        #print "end ADD NEW class"
        
    def OnBrowse(self, event):
        self.dirname=""
        d=wx.FileDialog(self, "Choose a file", self.dirname, "", "*.*", wx.Open)
        if d.ShowModal() == wx.ID_OK:
            self.filename=d.GetFilename()
            self.dirname=d.GetDirectory()
            self.text1.WriteTest(join(os.path.join(self.dirname, self.filename)))
        d.Destroy()
        
    def OnUpload(self, event):
        pass
                
class ParentWindow(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, "Euro Fund manager")
        self.createMenu()
        self.Bind(wx.EVT_MENU, self.onAddnewfund, id=ID_ADD_NEW)
        self.Bind(wx.EVT_MENU, self.onDeactivate, id=ID_DEACTIVATE)
        self.Bind(wx.EVT_MENU, self.onExit, id=ID_EXIT)
        self.spw=wx.SplitterWindow(self)
        self.p1=wx.Panel(self.spw, style=wx.BORDER_NONE)
        self.p1.SetBackgroundColour("white")
        self.p2=wx.Panel(self.spw, style=wx.BORDER_NONE)

        self.spw.SplitVertically(self.p1, self.p2, 200)

        self.CreateStatusBar()
        
    def createMenu(self):
        menu=wx.Menu()
        menu.Append(ID_ADD_NEW, "&Add new fund(s)", "Add new fund(s)")
        menu.Append(ID_DEACTIVATE, "&Deactivate fund(s)", "Deactivate fund(s)")
        menu.AppendSeparator()
        menu.Append(ID_EXIT, "E&xit", "Exit")

        menubar=wx.MenuBar()
        menubar.Append(menu, "&File")
        self.SetMenuBar(menubar)
        
    def onAddnewfund(self, event):      
        #p=wx.Panel(self.p2)
        #print "panel created"
        nb=wx.Notebook(self.p2)
        #print "notebook created"
        addPage=_AddNewFund(nb)
        nb.AddPage(addPage, "Add new Fund")
        #print "page got added"
        sizer=wx.BoxSizer()
        sizer.Add(nb, 1, wx.EXPAND)
        self.p2.SetSizer(sizer)
        #print "end of add function"
        
    def onDeactivate(self, event): pass
    
    def onExit(self, event):
        self.Close()


app = wx.App()
frm=ParentWindow()
frm.SetSize((800,500))
frm.Show()
app.SetTopWindow(frm)
app.MainLoop()

thank you,
Regards,
kath

Attachments
AppName: pythonw.exe	 AppVer: 0.0.0.0	 ModName: wxmsw26uh_vc.dll
ModVer: 2.6.3.3	 Offset: 0016bb6f

technical info.
<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="pythonw.exe" FILTER="GRABMI_FILTER_PRIVACY">
    <MATCHING_FILE NAME="MSVCRT.dll" SIZE="290869" CHECKSUM="0x46EE5D1C" BIN_FILE_VERSION="6.1.9359.0" BIN_PRODUCT_VERSION="6.1.9359.0" PRODUCT_VERSION="6.10.9359.0" FILE_DESCRIPTION="Microsoft (R) C Runtime Library" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft (R) Visual C++" FILE_VERSION="6.10.9359.0" ORIGINAL_FILENAME="MSVCRT.DLL" INTERNAL_NAME="MSVCRT.DLL" LEGAL_COPYRIGHT="Copyright (C) Microsoft Corp. 1981-1999" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x48405" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="6.1.9359.0" UPTO_BIN_PRODUCT_VERSION="6.1.9359.0" LINK_DATE="09/20/2001 21:52:56" UPTO_LINK_DATE="09/20/2001 21:52:56" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="Pythonwin.exe" SIZE="24638" CHECKSUM="0x48A05E5C" BIN_FILE_VERSION="2.3.0.163" BIN_PRODUCT_VERSION="2.3.0.163" PRODUCT_VERSION="2.3.0.163" FILE_DESCRIPTION="Pythonwin main executable" COMPANY_NAME="" PRODUCT_NAME="Python extension" FILE_VERSION="2.3.0.163" ORIGINAL_FILENAME="PYTHONWIN.EXE" INTERNAL_NAME="PYTHONWIN.EXE" LEGAL_COPYRIGHT="Copyright (C) A Few Assorted People 1995-1998.  All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.3.0.163" UPTO_BIN_PRODUCT_VERSION="2.3.0.163" LINK_DATE="11/03/2003 22:46:28" UPTO_LINK_DATE="11/03/2003 22:46:28" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="UNWISE.EXE" SIZE="164864" CHECKSUM="0x46DDAA6A" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="09/20/2001 14:28:41" UPTO_LINK_DATE="09/20/2001 14:28:41" />
    <MATCHING_FILE NAME="python.exe" SIZE="20539" CHECKSUM="0xB95D3A5A" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="02/08/2005 15:24:09" UPTO_LINK_DATE="02/08/2005 15:24:09" />
    <MATCHING_FILE NAME="pythonw.exe" SIZE="20540" CHECKSUM="0xBCE3C5D1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="02/08/2005 15:25:43" UPTO_LINK_DATE="02/08/2005 15:25:43" />
    <MATCHING_FILE NAME="w9xpopen.exe" SIZE="16384" CHECKSUM="0x8F0D16AB" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="02/08/2005 15:24:11" UPTO_LINK_DATE="02/08/2005 15:24:11" />
    <MATCHING_FILE NAME="RemoveMySQL-python.exe.exe" SIZE="20992" CHECKSUM="0x5E6D5E16" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="11/22/2002 20:46:17" UPTO_LINK_DATE="11/22/2002 20:46:17" />
    <MATCHING_FILE NAME="tix8184.dll" SIZE="262144" CHECKSUM="0x62E4B3FF" MODULE_TYPE="WIN32" PE_CHECKSUM="0x4216B" LINKER_VERSION="0x0" LINK_DATE="12/15/2003 00:12:03" UPTO_LINK_DATE="12/15/2003 00:12:03" />
    <MATCHING_FILE NAME="Removepy2exe.exe" SIZE="57344" CHECKSUM="0xD99E44E8" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="01/25/2005 22:09:32" UPTO_LINK_DATE="01/25/2005 22:09:32" />
    <MATCHING_FILE NAME="MSVCIRT.dll" SIZE="77878" CHECKSUM="0x91EA69DF" BIN_FILE_VERSION="6.1.8637.0" BIN_PRODUCT_VERSION="6.1.8637.0" PRODUCT_VERSION="6.10.8637.0" FILE_DESCRIPTION="Microsoft (R) C++ Runtime Library" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft (R) Visual C++" FILE_VERSION="6.10.8637.0" ORIGINAL_FILENAME="MSVCIRT.DLL" INTERNAL_NAME="MSVCIRT.DLL" LEGAL_COPYRIGHT="Copyright (C) Microsoft Corp. 1981-1999" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1888D" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="6.1.8637.0" UPTO_BIN_PRODUCT_VERSION="6.1.8637.0" LINK_DATE="09/30/1999 01:52:38" UPTO_LINK_DATE="09/30/1999 01:52:38" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="RemovePIL.exe" SIZE="20992" CHECKSUM="0x5E6D5E16" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="11/22/2002 20:46:17" UPTO_LINK_DATE="11/22/2002 20:46:17" />
    <MATCHING_FILE NAME="Removepycrypto.exe" SIZE="57344" CHECKSUM="0x8C8A4FE3" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="04/15/2004 17:51:00" UPTO_LINK_DATE="04/15/2004 17:51:00" />
    <MATCHING_FILE NAME="RemovepyOpenSSL.exe" SIZE="57344" CHECKSUM="0x8C8A4FE3" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="04/15/2004 17:51:00" UPTO_LINK_DATE="04/15/2004 17:51:00" />
    <MATCHING_FILE NAME="Removekinterbasdb.exe" SIZE="57344" CHECKSUM="0xD99E44E8" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="01/25/2005 22:09:32" UPTO_LINK_DATE="01/25/2005 22:09:32" />
    <MATCHING_FILE NAME="Removeegenix-mx-base.exe" SIZE="57344" CHECKSUM="0x8C8A4FE3" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="04/15/2004 17:51:00" UPTO_LINK_DATE="04/15/2004 17:51:00" />
    <MATCHING_FILE NAME="Removeegenix-mx-commercial.exe" SIZE="57344" CHECKSUM="0x8C8A4FE3" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="04/15/2004 17:51:00" UPTO_LINK_DATE="04/15/2004 17:51:00" />
    <MATCHING_FILE NAME="MSVCP60.dll" SIZE="401462" CHECKSUM="0xC32EC17D" BIN_FILE_VERSION="6.0.8972.0" BIN_PRODUCT_VERSION="6.0.8972.0" PRODUCT_VERSION="6.00.8972.0" FILE_DESCRIPTION="Microsoft (R) C++ Runtime Library" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft (R) Visual C++" FILE_VERSION="6.00.8972.0" ORIGINAL_FILENAME="MSVCP60.DLL" INTERNAL_NAME="MSVCP60.DLL" LEGAL_COPYRIGHT="Copyright (C) Microsoft Corp. 1981-1998" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x67CC0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="6.0.8972.0" UPTO_BIN_PRODUCT_VERSION="6.0.8972.0" LINK_DATE="09/01/2001 00:54:27" UPTO_LINK_DATE="09/01/2001 00:54:27" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="unicows.dll" SIZE="219136" CHECKSUM="0x3E949ED1" BIN_FILE_VERSION="1.0.3590.0" BIN_PRODUCT_VERSION="1.0.3590.0" PRODUCT_VERSION="1.0.3590.0" FILE_DESCRIPTION="Unicode Layer for Win9x" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft (R) Windows (R) 95, Windows (R) 98, and Windows (R) Millennium Operating Systems" FILE_VERSION="1.0.3590.0" ORIGINAL_FILENAME="UnicoWS.dll" INTERNAL_NAME="Godot" LEGAL_COPYRIGHT=" 2000-2001 Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x4003A" LINKER_VERSION="0x50001" UPTO_BIN_FILE_VERSION="1.0.3590.0" UPTO_BIN_PRODUCT_VERSION="1.0.3590.0" LINK_DATE="06/05/2004 01:21:45" UPTO_LINK_DATE="06/05/2004 01:21:45" VER_LANGUAGE="Language Neutral [0x0]" />
    <MATCHING_FILE NAME="unins000.exe" SIZE="72884" CHECKSUM="0x511F9CCD" BIN_FILE_VERSION="51.5.0.0" BIN_PRODUCT_VERSION="51.5.0.0" PRODUCT_VERSION=" " FILE_DESCRIPTION="Inno Setup Uninstaller" COMPANY_NAME="Jordan Russell" PRODUCT_NAME="" FILE_VERSION="51.5.0.0" ORIGINAL_FILENAME="" INTERNAL_NAME="" LEGAL_COPYRIGHT="Copyright (C) 1998-2001 Jordan Russell" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="51.5.0.0" UPTO_BIN_PRODUCT_VERSION="51.5.0.0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="Removexlrd.exe" SIZE="61440" CHECKSUM="0x916D9F80" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="02/03/2005 20:41:15" UPTO_LINK_DATE="02/03/2005 20:41:15" />
    <MATCHING_FILE NAME="DLLs\tcl84.dll" SIZE="569344" CHECKSUM="0xAAD688F5" BIN_FILE_VERSION="8.4.2.3" BIN_PRODUCT_VERSION="8.4.2.3" PRODUCT_VERSION="8.4.3" FILE_DESCRIPTION="Tcl DLL" COMPANY_NAME="ActiveState Corporation" PRODUCT_NAME="Tcl 8.4 for Windows" FILE_VERSION="8.4.3" ORIGINAL_FILENAME="tcl84.dll" LEGAL_COPYRIGHT="Copyright  2001 by ActiveState Corporation, et al" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x9422C" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="8.4.2.3" UPTO_BIN_PRODUCT_VERSION="8.4.2.3" LINK_DATE="03/31/2004 19:34:38" UPTO_LINK_DATE="03/31/2004 19:34:38" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="DLLs\tclpip84.dll" SIZE="4096" CHECKSUM="0x5A731F70" MODULE_TYPE="WIN32" PE_CHECKSUM="0x8661" LINKER_VERSION="0x0" LINK_DATE="03/31/2004 19:34:39" UPTO_LINK_DATE="03/31/2004 19:34:39" />
    <MATCHING_FILE NAME="DLLs\tk84.dll" SIZE="1011200" CHECKSUM="0xA097BB46" BIN_FILE_VERSION="8.4.2.3" BIN_PRODUCT_VERSION="8.4.2.3" PRODUCT_VERSION="8.4.3" FILE_DESCRIPTION="Tk DLL" COMPANY_NAME="ActiveState Corporation" PRODUCT_NAME="Tk 8.4 for Windows" FILE_VERSION="8.4.3" ORIGINAL_FILENAME="tk84.dll" LEGAL_COPYRIGHT="Copyright  2001 by ActiveState Corporation, et al" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x100B5B" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="8.4.2.3" UPTO_BIN_PRODUCT_VERSION="8.4.2.3" LINK_DATE="03/31/2004 19:41:11" UPTO_LINK_DATE="03/31/2004 19:41:11" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="DLLs\tix8184.dll" SIZE="262144" CHECKSUM="0x62E4F73F" MODULE_TYPE="WIN32" PE_CHECKSUM="0x4D31D" LINKER_VERSION="0x0" LINK_DATE="03/31/2004 20:45:28" UPTO_LINK_DATE="03/31/2004 20:45:28" />
    <MATCHING_FILE NAME="Lib\distutils\command\wininst.exe" SIZE="57344" CHECKSUM="0xD99E44E8" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="01/25/2005 22:09:32" UPTO_LINK_DATE="01/25/2005 22:09:32" />
    <MATCHING_FILE NAME="Lib\site-packages\UnWisePW32.exe" SIZE="162304" CHECKSUM="0x85F8B329" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="01/23/2001 16:48:03" UPTO_LINK_DATE="01/23/2001 16:48:03" />
    <MATCHING_FILE NAME="Lib\site-packages\py2exe\run.exe" SIZE="24576" CHECKSUM="0x1CFE5407" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="02/
This question has already been answered. Start a new discussion instead.