473,738 Members | 11,192 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wx: PyNoAppError

Hi!

Using XP SP2, PythonWin 2.4.3, any trying to use wx 2.6.3.2
When using wx, the first time I run a script it runs fine.
Second time, it rasises an error:

[Script]*************** *************** ****
import wx
app = wx.App()
win = wx.Frame(None, title="Simple Editor")
win.Show()
app.MainLoop()

[Error]*************** *************** *****
Traceback (most recent call last):
File
"C:\Python24\Li b\site-packages\python win\pywin\frame work\scriptutil s.py",
line 310, in RunScript
exec codeObject in __main__.__dict __
File "C:\Python24\my stuff\ool.pyw", line 3, in ?
win = wx.Frame(None, title="Simple Editor")
File "C:\Python24\Li b\site-packages\wx-2.6-msw-ansi\wx\_window s.py",
line 493, in __init__
newobj = _windows_.new_F rame(*args, **kwargs)
PyNoAppError: The wx.App object must be created first!
*************** *************** ************

So this happens no matter what the script is.
And it always occurs on the first line a new widget is created.
This is not a problem with the script, because it does the same
thing on every script I copied from the internet. It must be a
wx bug, but has anyone fixed it?
I googled and only found this:

http://mail.python.org/pipermail/tut...er/041678.html
*Not helpful
http://www.dogmelon.com.au/nsforum/v...44425e64c#5032
*Says that runnig the script outside of IDLE fixes the problem.
That works for me too but if there is a way to run it from IDLE
that would be much easier.

Any experience on this?
May 31 '06 #1
2 2217
SuperHik wrote:

(1) A wxPython question. Better to ask on the wxPython newsgroup
(listed as comp.python.wxp ython on gmane).
Using XP SP2, PythonWin 2.4.3, any trying to use wx 2.6.3.2
When using wx, the first time I run a script it runs fine.
Second time, it rasises an error: .... Up here you should have mentioned you are doing this in IDLE, that is
your problem.

Later in your message you say: ... *Says that runnig the script outside of IDLE fixes the problem.
That works for me too but if there is a way to run it from IDLE
that would be much easier.


This is the inevitable result of running a pair of GUIs simultaneously:
They both want control of the main program to run their idle loop, and
only can win.

--Scott David Daniels
sc***********@a cm.org
May 31 '06 #2
Scott David Daniels wrote:
SuperHik wrote:

(1) A wxPython question. Better to ask on the wxPython newsgroup
(listed as comp.python.wxp ython on gmane). I'm aware it's a wxPython question but I wasn't aware
of the group you mentioned. Thank you!
Using XP SP2, PythonWin 2.4.3, any trying to use wx 2.6.3.2
When using wx, the first time I run a script it runs fine.
Second time, it rasises an error: .... Up here you should have mentioned you are doing this in IDLE, that is
your problem.

Later in your message you say:
... *Says that runnig the script outside of IDLE fixes the problem.
That works for me too but if there is a way to run it from IDLE
that would be much easier.


This is the inevitable result of running a pair of GUIs simultaneously:
They both want control of the main program to run their idle loop, and
only can win.

I wasn't running them simultaneously. I ended the first (and only) one
and then tried to start it again.
--Scott David Daniels
sc***********@a cm.org

May 31 '06 #3

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

Similar topics

3
2174
by: bsharitt | last post by:
I'm trying to get Bittornado to run on Mac OS X (10.4 with Python 2.3.5) but I've only ever dealt with Python at lower lever scripting stuff, never wxPython or another GUI stuff. py2app is supposed to be the tool to create Mac friendly Python applications(like py2exe on Windows), but the documentation for py2app doesn't seem to be much help. The setup.py script that comes with BitTornado doesn't run when I type python setup.py py2app and...
3
2691
by: teh_sAbEr | last post by:
I'm busy trying to learn wxPython, and i'm trying to run the following piece of code (its from the wxPyWiki tutorial): import wx ID_ABOUT = 101 ID_EXIT = 110 class MainWindow(wx.Frame): def __init__(self,parent,id,title):
0
889
by: rinsukaze | last post by:
Hi! I'm a newbie around here, so sorry if it's a dumb question. I've been messing with a program for a while, for learning python, and recently I migrated my code to the 2.5.2. Once I did it my code got all wrong, and keeps on giving me the PyNoAppError. The code works as follow: class wxTheApp(wx.App): def OnInit(self): frame = wxMainFrame(None, title="Test") frame.Show() self.SetTopWindow(frame) ...
0
1815
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
8969
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9476
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9335
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...
1
9263
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
6751
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
6053
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3279
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
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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.