473,547 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\pyt honw.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(TopLevelW indow):
"""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=EmptyStri ng,
Point pos=DefaultPosi tion, Size size=DefaultSiz e,
long style=DEFAULT_F RAME_STYLE, String name=FrameNameS tr) -Frame
"""

# The following line is highlighted as where the error occures

_windows_.Frame _swiginit(self, _windows_.new_F rame(*args, **kwargs))
self._setOORInf o(self)
RUNNING THE SIMPLE.PY SCRIPT FROM WITHIN IDLE PRODUCES THE FOLLOWING
ERROE MESSAGE:

Traceback (most recent call last):
File "C:\Documen ts and Settings\Peter\ My Documents\Dev\P ython\WxPython
Tutorial\absolu te.py", line 28, in <module>
Absolute(None, -1, '')
File "C:\Documen ts and Settings\Peter\ My Documents\Dev\P ython\WxPython
Tutorial\absolu te.py", line 9, in __init__
wx.Frame.__init __(self, parent, id, title, size=(250, 180))
File
"C:\Python25\Li b\site-packages\wx-2.8-msw-unicode\wx\_win dows.py",
line 505, in __init__
_windows_.Frame _swiginit(self, _windows_.new_F rame(*args, **kwargs))
PyNoAppError: The wx.App object must be created first!

Sep 6 '08 #1
0 1799

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

Similar topics

5
4187
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++ syntax in the main wxWindows documentation. It also says that the samples will help, but I can't seem to make sense of them. Should I just use a...
7
11886
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 wxPython. Mitchell Timin -- "Many are stubborn in pursuit of the path they have chosen, few in
1
2553
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 everything. The make install in $WXDIR seemed to go fine. I have the libxw* libraries in my lib/ directory libwx_base-2.5.so@ ...
1
2972
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. wxPython is my only hold-out on my current system. wxPython seems to need gnome. So I have tried to build garnome and it didn't build all the way..and,...
0
1649
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 version, many of which are listed below and at http://wxpython.org/recentchanges.php. What is wxPython?
6
2392
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 features" discovered in the 2.6.3.0 release made last week. A summary of changes is listed below and at http://wxpython.org/recentchanges.php.
0
1305
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 features" discovered in the 2.6.3.0 release made last week. A summary of changes is listed below and at http://wxpython.org/recentchanges.php.
2
2900
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): File "/Users/marco/Desktop/flexo1/wxpython/wxPython-src-2.8.3.0/ wxPython/setup.py", line 49, in <module> copy_file('config.py', 'wx/build',...
4
2967
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 Python, it now seems to me that wxPython is thé choice for my kind of applications. I've no experience with wxPython yet, I just run a few...
8
2641
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 this problem. ~Sean
0
7507
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7698
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
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...
1
7461
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6030
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...
0
5080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3492
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...
1
1922
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
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.