As with most other modern Tk bindings, Tkinter is implemented as a Python wrapper around a complete Tcl interpreter embedded in the Python interpreter. Tkinter calls are translated into Tcl commands, which are fed to this embedded interpreter, thus making it possible to mix Python and Tcl in a single application.
There are several popular GUI library alternatives available, such as Kivy, Pygame, Pyglet, PyGObject, PyQt, PySide, and wxPython.
This term has different meanings in different contexts, but in general it refers to a rectangular area somewhere on the user's display screen.
A window which acts as a child of the primary window. It will be decorated with the standard frame and controls for the desktop manager. It can be moved around the desktop and can usually be resized.
The generic term for any of the building blocks that make up an application in a graphical user interface.
In Tkinter, the Frame widget is the basic unit of organization for complex layouts. A frame is a rectangular area that can contain other widgets.
When any widget is created, a parent–child relationship is created. For example, if you place a text label inside a frame, the frame is the parent of the label.
Below is a minimal Python 3 Tkinter application with one widget:9
For Python 2, the only difference is the word "tkinter" in the import command will be capitalized to "Tkinter".10
There are four stages to creating a widget11
These are often compressed, and the order can vary.
Using the object-oriented paradigm in Python, a simple program would be (requires Tcl version 8.6, which is not used by Python on MacOS by default):
"Tkinter — Python interface to Tcl/Tk — Python v2.6.1 documentation". Retrieved 2009-03-12. https://docs.python.org/library/tkinter.html ↩
"Tkinter - Pythoninfo Wiki". https://wiki.python.org/moin/TkInter ↩
tkinter—Python interface to Tcl/Tk—Python 3.9.10 Documentation https://docs.python.org/3.9/library/tkinter ↩
Shipman, John W. (2010-12-12), Tkinter reference: a GUI for Python, New Mexico Tech Computer Center, retrieved 2012-01-11 https://tkdocs.com/shipman/ ↩
"Tkinter - Tkinter Wiki". Archived from the original on 2013-11-13. Retrieved 2013-11-13. https://web.archive.org/web/20131113222939/http://tkinter.unpythonic.net/wiki/Tkinter ↩
"Python issue #2983, "Ttk support for Tkinter"". http://bugs.python.org/issue2983 ↩
"Python subversion revision 69051, which resolves issue #2983 by adding the ttk module". http://svn.python.org/view?view=rev&revision=69051 ↩
"Tkinter ttk widgets - Python Tutorial". CodersLegacy. Retrieved 2022-01-13. https://coderslegacy.com/python/tkinter-ttk-widgets-tutorial/ ↩
"Tkinter 8.5 reference: a GUI for Python". https://tkdocs.com/shipman/minimal-app.html ↩
Fleck, Dan. "Tkinter – GUIs in Python" (PDF). CS112. George Mason University. Retrieved 18 August 2018. https://cs.gmu.edu/~dfleck/classes/cs112/spring08/slides/tkinter.pdf ↩
Klein, Bernd. "GUI Programming with Python: Events and Binds". www.python-course.eu. Retrieved 18 August 2018. https://www.python-course.eu/tkinter_events_binds.php ↩
"PEP 397 — Python launcher for Windows — Python.org". Retrieved 2017-06-07. https://www.python.org/dev/peps/pep-0397 ↩