Managing timing in Python calls
nospam at forMe.thks
Mon Dec 15 17:29:39 CET 2008
bieffe62 at gmail.com wrote:
> Python has in its standard library a timer class which actually is
> implemented as a thread (I think) ...
> however, when using a GUI package, I think it is better to use gui-
> specific functions for event-driven programming,
> to make sure that your code do not mess with GUI event loop and to
> work around the lack of thread-safety in some GUI libraries.
> This applies to timer/timeouts but also to execute code when specific
> I/O events occur ( e.g. the receiving of data from a socket ).
> Although I'm not an expert of pywx, a quick search pointed me to this
> from which it seams that WxTimerEvent couldbe what you need.
> I agree with you that for loading images from local files a thread
> should not be needed.
> P.S : notice that the documentation refers to the C++ library on which
> the python wrapper is built. This is often the case for
> python wrapper of GUI libraries. However, the most important ones come
> with a rich set of demo programs (and pywx demo suite is quite
> complete) from which one can lear what he needs.
The wxTimerEvent does sound attractive - I'll look into that.
Thanks too for the opinion on loading images - gives me some guts to
just give it a try without threading it and see how it goes.
I appreciate the quick input :)
More information about the Python-list