473,889 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Serious wxPython Error while executing..

Hello, sorry about the lengthy message.

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.ex e 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 is

"AppName: pythonw.exe AppVer: 0.0.0.0 ModName: wxmsw26uh_vc.dl l
ModVer: 2.6.3.3 Offset: 0016bb6f
<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="pythonw.e xe" FILTER="GRABMI_ FILTER_PRIVACY" >
<MATCHING_FIL E NAME="MSVCRT.dl l" SIZE="290869"
CHECKSUM="0x46E E5D1C" BIN_FILE_VERSIO N="6.1.9359.0 "

BIN_PRODUCT_VER SION="6.1.9359. 0" PRODUCT_VERSION ="6.10.9359. 0"
FILE_DESCRIPTIO N="Microsoft (R) C Runtime Library"

COMPANY_NAME="M icrosoft Corporation" PRODUCT_NAME="M icrosoft (R) Visual
C++" FILE_VERSION="6 .10.9359.0"

ORIGINAL_FILENA ME="MSVCRT.DLL " INTERNAL_NAME=" MSVCRT.DLL"
LEGAL_COPYRIGHT ="Copyright (C) Microsoft Corp. 1981-1999"

VERFILEDATEHI=" 0x0" VERFILEDATELO=" 0x0" VERFILEOS="0x40 004"
VERFILETYPE="0x 2" MODULE_TYPE="WI N32" PE_CHECKSUM="0x 48405"

LINKER_VERSION= "0x0" UPTO_BIN_FILE_V ERSION="6.1.935 9.0"
UPTO_BIN_PRODUC T_VERSION="6.1. 9359.0" LINK_DATE="09/20/2001 21:52:56"

UPTO_LINK_DATE= "09/20/2001 21:52:56" VER_LANGUAGE="E nglish (United
States) [0x409]" />
............... "

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.

Expand|Select|Wrap|Line Numbers
  1. import wx
  2.  
  3. ID_ADD_NEW = 5001
  4. ID_DEACTIVATE = 5002
  5. ID_EXIT = 5003
  6.  
  7. class _AddNewFund(wx.Panel):
  8. def __init__(self, parent):
  9. wx.Panel.__init__(self, parent)
  10. box=wx.StaticBox(self, -1, "Add New Fund")
  11. boxsizer=wx.StaticBoxSizer(box, wx.HORIZONTAL)
  12.  
  13. t=wx.StaticText(self, -1, "Please select an Excel file to
  14. upload new funds.", (20,20))
  15. boxsizer.Add(t, 0, wx.TOP|wx.LEFT, 10)
  16. t=wx.StaticText(self, -1, "This is page one content2", (20,40))
  17. boxsizer.Add(t, 0, wx.TOP|wx.LEFT, 10)
  18.  
  19. self.text1=wx.TextCtrl(self, -1, "")
  20.  
  21. b1 = wx.Button(self, 10, " Browse ")
  22. b2 = wx.Button(self, 10, " Upload ", (60, 20))
  23. self.Bind(wx.EVT_BUTTON, self.OnBrowse, b1)
  24. self.Bind(wx.EVT_BUTTON, self.OnUpload, b2)
  25. b1.SetDefault()
  26. b1.SetSize(b1.GetBestSize())
  27. b2.SetSize(b2.GetBestSize())
  28.  
  29. grid1=wx.FlexGridSizer(0,2,0,0)
  30. grid1.Add( self.text1, 0,
  31. wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
  32. grid1.Add( b1, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
  33. #grid1.Add( b2, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
  34. border=wx.BoxSizer()
  35. border.Add(boxsizer, 1, wx.EXPAND)
  36. self.SetSizer(border)
  37. boxsizer.Add(grid1, 0, wx.ALIGN_CENTRE)
  38. border.Add(boxsizer, 0, wx.ALIGN_CENTRE)
  39. #print "end ADD NEW class"
  40.  
  41. def OnBrowse(self, event):
  42. self.dirname=""
  43. d=wx.FileDialog(self, "Choose a file", self.dirname, "", "*.*",
  44. wx.Open)
  45. if d.ShowModal() == wx.ID_OK:
  46. self.filename=d.GetFilename()
  47. self.dirname=d.GetDirectory()
  48. self.text1.WriteTest(join(os.path.join(self.dirname,
  49. self.filename)))
  50. d.Destroy()
  51.  
  52. def OnUpload(self, event):
  53. pass
  54.  
  55. class ParentWindow(wx.Frame):
  56. def __init__(self):
  57. wx.Frame.__init__(self, None, -1, "Euro Fund manager")
  58. self.createMenu()
  59. self.Bind(wx.EVT_MENU, self.onAddnewfund, id=ID_ADD_NEW)
  60. self.Bind(wx.EVT_MENU, self.onDeactivate, id=ID_DEACTIVATE)
  61. self.Bind(wx.EVT_MENU, self.onExit, id=ID_EXIT)
  62. self.spw=wx.SplitterWindow(self)
  63. self.p1=wx.Panel(self.spw, style=wx.BORDER_NONE)
  64. self.p1.SetBackgroundColour("white")
  65. self.p2=wx.Panel(self.spw, style=wx.BORDER_NONE)
  66.  
  67. self.spw.SplitVertically(self.p1, self.p2, 200)
  68.  
  69. self.CreateStatusBar()
  70.  
  71. def createMenu(self):
  72. menu=wx.Menu()
  73. menu.Append(ID_ADD_NEW, "&Add new fund(s)", "Add new fund(s)")
  74. menu.Append(ID_DEACTIVATE, "&Deactivate fund(s)", "Deactivate
  75. fund(s)")
  76. menu.AppendSeparator()
  77. menu.Append(ID_EXIT, "E&xit", "Exit")
  78.  
  79. menubar=wx.MenuBar()
  80. menubar.Append(menu, "&File")
  81. self.SetMenuBar(menubar)
  82.  
  83. def onAddnewfund(self, event):
  84. #p=wx.Panel(self.p2)
  85. #print "panel created"
  86. nb=wx.Notebook(self.p2)
  87. #print "notebook created"
  88. addPage=_AddNewFund(nb)
  89. nb.AddPage(addPage, "Add new Fund")
  90. #print "page got added"
  91. sizer=wx.BoxSizer()
  92. sizer.Add(nb, 1, wx.EXPAND)
  93. self.p2.SetSizer(sizer)
  94. #print "end of add function"
  95.  
  96. def onDeactivate(self, event): pass
  97.  
  98. def onExit(self, event):
  99. self.Close()
  100.  
  101.  
  102. app = wx.App()
  103. frm=ParentWindow()
  104. frm.SetSize((800,500))
  105. frm.Show()
  106. app.SetTopWindow(frm)
  107. app.MainLoop()
  108.  
  109.  


thank you,
Regards,
kath

Oct 30 '06 #1
1 2275
kath wrote:
Hello, sorry about the lengthy message.

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.ex e has encountered a problem and needs to close. We are
sorry for the inconvenience"
I get a segmentation fault on Linux, after running the script, choosing
"Add new fund" from the menu, and then closing the application. I don't
get the segmentation fault if I merely start the app and close it.
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.
You actually have several problems. But, the segmentation fault appears
to be directly related to the fact that you add boxsizer to the border
sizer twice.

Another problem is that you create the notebook every single time, and
add just one page to it, but you probably want just one notebook with
one or more pages.

--
pkm ~ http://paulmcnett.com
Oct 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2114
by: John Kinson | last post by:
Hi, I'm trying to get the wxPython demo to run on a Debian sarge testing installation, but encounter the following error when I run the demo script: # ./demo.py Traceback (most recent call last): File "./demo.py", line 4, in ? Main.main() File "/root/Python/wxPython-2.5.1.5/demo/Main.py", line 946, in main
6
5875
by: twsnnva | last post by:
Could anyone give me an example (code) of a simple program with a button that when clicked executes a linux shell or windows dos command like "ifconfig" or "ipconfig" and prints the output somewhere in the same window. Thanks.
13
4595
by: Peter Maas | last post by:
Recently I replaced Win2k with Linux on my desktop computer. Using mostly multi-platform software I thought this would be easy. It was not as easy as expected getting wxPython to work. There seemed to be no SuSE RPM so I installed from source. Here are my steps (gtk 2.4 was already installed): - Built wxWidgets (.configure --enable-unicode) - Built wxPython (python setup.py install) error: "you should use wx-config program for...
2
4046
by: Grzegorz | last post by:
Hello, I'm using eclipse with pydev plugin, I'm working on a program using wxpython . When I'm executing that application standard error output does not show in eclipse console window - wxpython seems to redirect standard output to some another window , and closes that window immediately, so I can't see any error messagess. Is there a way to redirect standard output to eclipse console ?
0
2047
by: Joseph | last post by:
I've encountered a DB2 error that seems to be quite serious. This is from DB2 7.2.5 running on Windows 2000 Server. Here are the entries from the db2diag.log file (with database name changed per my employer's policy): =============================================================================== 2004-02-16-13.28.49.037000 Instance:DB2 Node:000 PID:3368(db2syscs.exe) TID:2920 Appid:*LOCAL.DB2.040216212729 database_utilities ...
9
5569
by: zxo102 | last post by:
Hi everyone, I am using a python socket server to collect data from a socket client and then control a image location ( wxpython) with the data, i.e. moving the image around in the wxpython frame. But the "app.MainLoop()" in wxpython looks like conflicting with the "while 1:" in socket server. After I commented the "app.MainLoop()", everything is working except two things: 1. if I click anywhere on the screen with the mouse, the image is...
2
5347
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: 1>make_buildinfo.obj : error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function _make_buildinfo2 Ask on python-list@python.org . - Josiah
2
3964
by: Kevin Walzer | last post by:
I'm porting a Tkinter application to wxPython and had a question about wxPython's event loop. The Tkinter app provides a GUI to a command-line tool. It gathers user input, and opens an asynchronous pipe to the external tool via os.popen(). Then, it dumps the output from the external process into a text display. Although threads are often recommended for use with GUI apps, I am able to keep the GUI responsive with Tkinter's event loop,...
0
1823
by: Stef Mientki | last post by:
Peter Anderson wrote: In PyScripter, you should run wxPython in the plain remote machine (not the wxPython remote), and you should set "reset before run flag" or reset the remote machine each time yourself. cheers, Stef
0
10791
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10442
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9609
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5829
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6029
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4647
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4251
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3256
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.