From: John H. <jd...@gm...> - 2009-04-29 14:30:03
|
On Wed, Apr 29, 2009 at 9:07 AM, keflavich <kef...@gm...> wrote: > > Since there don't seem to be any forthcoming answers, I have a somewhat > different question. In the matplotlib FAQ, it states that using 'show()' > puts you in the GUI mainloop > (http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show). However, > using plot commands on the ipython command line does not shut down the > command line generally. I gathered from some googling that this is because > ipython starts up the matplotlib graphics in a different 'thread', but I > don't understand how this is done and most of what I've seen says it is > bad. > most GUI mainloops are blocking, so after you start them you cannot issue more commands from an interactive shell. Either you need to run a GUI shell, or in the case of ipython run the GUI in a separate thread. One exception to this is tkinter (tkagg), which plays nicely with a standard python shell. I understand that recent versions of pygtk work also w/o running the mainloop in a separate thread, but I haven't dug into the details. > > So, my question now: How can I exit the GUI mainloop without closing the > graphics windows? > This question doesn't really make sense to me. Perhaps you can clearly describe your use case (what you need to do) rather than the proposed solutions. JDH |