tkinter automatically creates a TopLevel window for you, when you execute your first operation in tkinter. You can start with this first window, by referencing Tk().

   1 import tkinter
   2 root = tkinter.Tk()
   3 

Constructor

argument

meaning

screenName

?

baseName

?

className ='Tk'

?

useTk =1

?

Notes

Hiding the Root Window

If you wanted to use tkinter without the UI -- perhaps, say, to read values from a GIF file, you can withdraw the Tk root window:

   1 import tkinter
   2 root = tkinter.Tk()
   3 root.withdraw()    # hide the window that appeared
   4 

See Also

tkinter: Tk (last edited 2010-11-02 00:05:07 by LionKimbro)