473,602 Members | 2,853 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 2211
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
2170
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
2686
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
886
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
1806
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
7924
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8411
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
8404
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
6731
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...
0
5440
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();...
0
3902
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
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2426
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
1513
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.