Problems with WX and program loop...
arkanes at gmail.com
Wed Jan 11 20:39:15 CET 2006
On 11 Jan 2006 10:33:08 -0800, Mr BigSmoke <fabio.pliger at gmail.com> wrote:
> Hi everybody... I have an app that has to controll some ascii files
> every 10/30 seconds... I was planning to have an GUI using wxpython.
> The problems is that i wasn't able to manage my application loop and
> the wxApp loop, so my interface is always freezing...
> My app do something like this:
> - creates a new wx and wxframe instance
> - loads some configuration info
> - starts looping every 30 seconds (while True: sleep(30); do something,
> - update some labels and textboxes on my frame...
> On every loop step, if i find some info in those ascii files i want to
> change some labels on my wxFrame... But my frame just freezes...
> because of the loop.
> Any hint?
> I'll post some of the code down here...
Welcome to the exciting world of event-based programming ;)
You want to use a wx.Timer to trigger your event every 30 seconds
instead of sleeping.
More information about the Python-list