Tkinter Confusion

Marc 'BlackJack' Rintsch bj_666 at
Mon Feb 18 00:40:34 CET 2008

On Sun, 17 Feb 2008 11:36:25 -0800, MartinRinehart wrote:

> Everything I've read about Tkinter says you create your window and
> then call its mainloop() method. But that's not really true. This is
> enough to launch a default window from the console:
>>>>from Tkinter import *
>>>>foo = Tk()

Depends on the platform if this shows a window.

> Do I use Tk() or toplevel()? (Support for both and if a cogent
> explanation of the differences exists, I didn't find it.)

`Tk` is the main window, `Toplevel` for additional windows.  Don't create
several `Tk` instances.  That usually causes very weird side effects.

	Marc 'BlackJack' Rintsch

More information about the Python-list mailing list