[AstroPy] Re: gui/thread issues

Perry Greenfield perry at stsci.edu
Mon May 23 14:25:04 EDT 2005


On May 23, 2005, at 2:03 PM, David King wrote:
>
> In the short run, I would be ok just using Tk alone on IPython or plain
> Python, although I'd be happiest having the whole picture.  In the 
> long run,
> our project will want to serve varied users, who will no doubt want to 
> use
> python in their own way.
>
Note that Tkinter windows under the standard Python interpreter are 
only 'alive' when the intepreter prompt is active. If you invoke a 
function that takes a long time, the window will be unresponsive since 
the Tk events are only handled within the Python interpreter loop. In 
this respect IPython should have an advantage with threading.

>
> I will continue to study what I have (that forum-thread link was 
> helpful
> too--thanks).  But I can't help feeling other python gui programmers 
> must
> run up against this problem too, and wonder why practically all the 
> standard
> Tkinter doc (including Grayson's book) just says "you gotta call 
> mainloop()
> to make anything actually appear and respond in Tkinter" (manifestly 
> untrue).

I think the problem is that, by and large, almost all uses of GUIs are 
centered on their being standalone applications and thus little thought 
is given to having a command line coexisting with the GUI. Our needs 
are pretty atypical in this regard.

Perry Greenfield




More information about the AstroPy mailing list