Graphical User Interfaces with Tk¶
Tk/Tcl has long been an integral part of Python. It provides a robust andplatform independent windowing toolkit, that is available to Python programmersusing thetkinter
package, and its extension, thetkinter.ttk
module.
Thetkinter
package is a thin object-oriented layer on top of Tcl/Tk. Tousetkinter
, you don’t need to write Tcl code, but you will need toconsult the Tk documentation, and occasionally the Tcl documentation.tkinter
is a set of wrappers that implement the Tk widgets as Pythonclasses.
tkinter
’s chief virtues are that it is fast, and that it usually comesbundled with Python. Although its standard documentation is weak, goodmaterial is available, which includes: references, tutorials, a book andothers.tkinter
is also famous for having an outdated look and feel,which has been vastly improved in Tk 8.5. Nevertheless, there are many otherGUI libraries that you could be interested in. The Python wiki lists severalalternativeGUI frameworks and tools.
tkinter
— Python interface to Tcl/Tktkinter.colorchooser
— Color choosing dialogtkinter.font
— Tkinter font wrapper- Tkinter Dialogs
tkinter.messagebox
— Tkinter message promptstkinter.scrolledtext
— Scrolled Text Widgettkinter.dnd
— Drag and drop supporttkinter.ttk
— Tk themed widgets- IDLE — Python editor and shell