From: Fernando P. <Fer...@co...> - 2005-02-01 00:14:35
|
John Hunter wrote: > Just a guess, > > The problem may be arising when the backend tries to quit when the > total figure count reaches zero. The relevant backend_tkagg section > is > > def destroy(self, *args): > if Gcf.get_num_fig_managers()==0 and not matplotlib.is_interactive(): > if self.window is not None: > self.window.quit() > if self.window is not None: > #print 'calling window destroy' > self.window.destroy() > self.window = None > > Try playing with this function and see if you can deduce where the > problem is. Sorry, but no luck. I tried a few simple things and made no progress, and I really can't spend more time on this right now. But I did find something bizarre. Consider: planck[pylab]> cat tkbug.py from matplotlib import pylab pylab.plot(range(10)) pylab.show() # Now I try to run this with plain python, no ipython in sight: planck[pylab]> python tkbug.py >>> The '>>>' prompt came in after I closed the plot window, and this is exactly the same thing I see with ipython: I get tossed into a naked python prompt, which is half-broken. With ipython, you get all sorts of weird errors related to ipython having been torn down already. With plain python, the only obvious sign of trouble is that readline is broken (^]]A instead of up-arrow, etc.) So something fishy is going on there, but I really don't have time to track it down. For now, I'll live with my hackish 'window sentinel' approach, ugly as it may be. Cheers, f |