Source

sphinx / Doc-3k / library / tk.rst

Graphical User Interfaces with Tk

Tk/Tcl has long been an integral part of Python. It provides a robust and platform independent windowing toolkit, that is available to Python programmers using the :mod:`Tkinter` module, and its extension, the :mod:`Tix` module.

The :mod:`Tkinter` module is a thin object-oriented layer on top of Tcl/Tk. To use :mod:`Tkinter`, you don't need to write Tcl code, but you will need to consult the Tk documentation, and occasionally the Tcl documentation. :mod:`Tkinter` is a set of wrappers that implement the Tk widgets as Python classes. In addition, the internal module :mod:`_tkinter` provides a threadsafe mechanism which allows Python and Tcl to interact.

:mod:`Tkinter`'s chief virtues are that it is fast, and that it usually comes bundled with Python. Although it has been used to create some very good applications, including IDLE, it has weak documentation and an outdated look and feel. For more modern, better documented, and much more extensive GUI libraries, see the :ref:`other-gui-packages` section.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.