Strange terminal behavior after quitting Tkinter application

Chris ceball at gmail.com
Fri May 4 11:02:13 EDT 2007


On May 4, 8:52 pm, "Hamilton, William " <wham... at entergy.com> wrote:
> > -----Original Message-----
> > From: Chris
> > Subject: Re: Strange terminal behavior after quittingTkinter
> application
> > Clicking 'Quit' or on the window's 'x' causes the application to quit
> > without messing up the terminal. With root.mainloop() commented out,
> > though, no combination of root.quit(), root.destroy(), and sys.exit()
> > stops the terminal from getting messed up.
>
> > So, I should call mainloop() for my application...except that I want
> > to use the commandline, too, and calling mainloop() freezes the
> > commandline. I wonder if there is another way to use the commandline
> > and have a GUI? I couldn't find any clear information about that.
>
> Can you run it in the background?  IIRC, if you put an ampersand ('&')
> at the end of the command line, it will run as a background process and
> leave your command line available for other tasks.  (The marker may be
> something other than &, it's been a long, long time since I've used *nix
> in a gui environment.)

Ah, sorry, I wasn't being precise. I meant the python commandline
python interpreter.

So from a terminal I type (for example):
python -i application.py

This launches the interpreter in my terminal. Then I can start the GUI
(by typing "Application()", for example). If I use mainloop(), I can't
interact with the interpreter from the terminal until I quit the GUI.
Without mainloop(), I can continue to enter python commands.




More information about the Python-list mailing list