On Mon, Oct 30, 2006 at 12:37:42PM -0700, Fernando Perez wrote: > Jut to clarify, Gael: in ipython (with -pylab or -{g,w,q}thread), what > happens is that IPython lets the GUI toolkit run in the main thread, > and then attaches its own routines for user code execution as the > toolkit's idle timer callback and runs in a secondary thread (each > toolkit has its own way of doing this, but the basic idea is the > same).
OK, similar to launching a wx application and starting a thread in it with ipython attached to this thread ? Is there a "hook" to the main eventloop that would be accessible to the code running in ipython. Thus a wx.CallAfter or alike in different toolkits, and other eventloop and multi-threaded programming tricks might be useful here. Maybe this solution would even provide the solution for blocking calls with MPL with most multi-threaded cases. The problem I hit in my first attempt was that the "connect" call executed in my function did not seem to be executed until the function returned. If I can connect a callback to the figure in the beginning of the function, then loop waiting and checking a parameter the will be set be the callback, then process the parameter when available. I do not see why this could not work, but then my understanding of multithreaded programming is quite poor. > This two-thread arrangement has a big drawback: the inability to > interrupt long-running calculations (even non-blocking ones) with > Ctrl-C, because it is simply impossible in Python to toss asynchronous > signals accross threads. Yes :-<. Have you tried getting some help from a guru, it seems to be worth the while. Cheers, GaÃl ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel