Tkinter8_09abd08371cd27ea4300250e6135585c
Tkinter8_09abd08371cd27ea4300250e6135585c
Python Tkinter
Tkinter (Tk)
• Tkinter widget library originates from the Tool Command Language (Tcl)
programming language.
• Tcl and Tk were created by John Ousterman while he was a professor at Berkeley in
the late 1980s as an easier way to program engineering tools being used at the
university.
• Tkinter is a Python interface to the Tk GUI library and has been a part of the Python
standard library since 1994 with the release of Python version 1.1, making it the de
facto GUI library for Python
Python Tkinter
• Tkinter might be the wrong choice for a game UI or slick commercial application;
• however, for data-driven applications, simple utilities, configuration dialogs, and other
business logic applications, Tkinter offers all that is needed and more.
Installing Python 3 /Tkinter on Windows
• You can obtain Python 3 installers for Windows from the python.org website by
performing the following steps:
1. Go to http://www.python.org/downloads/windows.
2. Select the latest Python 3 release.
3. Under the Files section, select the Windows executable installer appropriate to your
system's architecture (x86 for 32-bit Windows OR x86_64 for 64-bit Windows).
4. Launch the downloaded installer.
5. Click on Customize installation. Make sure the tcl/tk and IDLE option is checked
(it should be by default).
6. Continue through the installer with all defaults.
• Note: To find out if Tkinter is installed, open a CMD Terminal and try the following
command: python3 -m tkinter
Basic Tkinter Window
To create Basic Tkinter Window To Add Title
root = Tk()
from tkinter import * root.title(‘My Tkinter Project’)
from tkinter.ttk import * label = Label(root, text="Hello World")
root = Tk() label.pack()
root.mainloop() root.mainloop()