473,237 Members | 1,266 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

Re: wxPython problem

Peter Anderson wrote:
I am trying to teach myself how to program in Python and use wxPython
for GUIs. I am using PyScripter, IDLE and EditPlus as my IDEs. I have
experienced an odd problem where I run a script once and it runs fine.
Run it again and I get an error and the script fails.

If the script is run directly from Python ('Run' from Windows
Explorer) or from EditPlus (in which I have a "user-defined tool"
which calls C:\Python25\pythonw.exe with the parameter of $(FileName))
then there is *never* any error, no matter how many times the script
is run.

Close down PyScripter or IDLE and then start either up again, load the
script and run it - it runs fine. Run it again and it fails. It seems
like something is already set in memory and cant be re-set (my lack of
knowledge is showing here :-( ).
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
More details are shown below. Any help or hints would be greatly
appreciated.

Regards,
Peter
RUNNING SIMPLE.PY (AND OTHER SCRIPTS USING WXPYTHON) FROM PYSCRIPTER I
GET THE FOLLOWING ERROR MESSAGE:

PyNoAppError: The wx.App object must be created first!

PyScripter loads a module (I presume from wxPython) called _windows.py
and highlights a particular line in red and displays the error message
from above. I have Googled the error message but the results have not
helped.
LISTING FOR SIMPLE.PY

#!/usr/bin/python

# simple.py

import wx

app = wx.App()

frame = wx.Frame(None, -1, 'simple.py')
frame.Show()

app.MainLoop()
EXERPT FROM _WINDOWS.PY - PYSCRIPTER HIGHLIGHTS SECOND LAST LINE

class Frame(TopLevelWindow):
"""Proxy of C++ Frame class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v),
doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, String title=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=DEFAULT_FRAME_STYLE, String name=FrameNameStr) -Frame
"""

# The following line is highlighted as where the error occures

_windows_.Frame_swiginit(self,_windows_.new_Frame( *args, **kwargs))
self._setOORInfo(self)
RUNNING THE SIMPLE.PY SCRIPT FROM WITHIN IDLE PRODUCES THE FOLLOWING
ERROE MESSAGE:

Traceback (most recent call last):
File "C:\Documents and Settings\Peter\My Documents\Dev\Python\WxPython
Tutorial\absolute.py", line 28, in <module>
Absolute(None, -1, '')
File "C:\Documents and Settings\Peter\My Documents\Dev\Python\WxPython
Tutorial\absolute.py", line 9, in __init__
wx.Frame.__init__(self, parent, id, title, size=(250, 180))
File
"C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py",
line 505, in __init__
_windows_.Frame_swiginit(self,_windows_.new_Frame( *args, **kwargs))
PyNoAppError: The wx.App object must be created first!

Sep 6 '08 #1
0 1767

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

Similar topics

5
by: Daniel Ehrenberg | last post by:
I'm trying to learn wxPython, but I can't seem to find much documentation. The wxPython website says that all advanced (and even some basic) documentation for wxPython is only available in C++...
7
by: SeeBelow | last post by:
Do many people think that wxPython should replace Tkinter? Is this likely to happen? I ask because I have just started learning Tkinter, and I wonder if I should abandon it in favor of...
1
by: timothy.williams | last post by:
I'm trying to install wxPython 2.5.3.1 using Python 2.3.2 on a Fedora 2 machine. I have python in a non-standard place, but I'm using --prefix with the configure script to point to where I have...
1
by: James Stroud | last post by:
Hello All, I will soon have an excuse to install a new operating system on my computer. I would like to know exactly what operating system I should have so that I can get wxPython going....
0
by: Robin Dunn | last post by:
Announcing ---------- The 2.6.3.0 release of wxPython is now available for download at http://wxpython.org/download.php. There have been many enhancements and fixes implemented in this...
6
by: Robin Dunn | last post by:
Announcing ---------- The 2.6.3.2 release of wxPython is now available for download at http://wxpython.org/download.php. This is a mostly bug fix release and takes care of several "unfortunate...
0
by: Robin Dunn | last post by:
Announcing ---------- The 2.6.3.2 release of wxPython is now available for download at http://wxpython.org/download.php. This is a mostly bug fix release and takes care of several "unfortunate...
2
by: Marco | last post by:
Hi, I have a problem to install wxPython on my MacBook (Pythonversion 2.5). If would install the wxPython (python setup.py install), then I got this error: Traceback (most recent call last):...
4
by: stef | last post by:
hello, I'm trying to move from Delphi to Python (move from MatLab to Python already succeeded, also thanks to this discussion group). From the discussions in this list about "the best" GUI for...
8
by: Sean DiZazzo | last post by:
Is there something special you have to do to get a wxPython app to run remotely under xwindows? My Tkinter apps always automatically work that way, so I was surprised to even be confronted with...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.