Tkinter

What is Python?

What is Python?

Python is a dynamic, object-oriented programming language with a wide range of applications. The Python programming language was created with programmer productivity and readability in mind. Python was influenced by ABC, Haskell, Java, Lisp, Icon, and Perl. Python is a high-level, multiplatform, interpreted language with a wide range of applications. Python is an excellent language for learning GUI development.

What are Widgets?

Widgets are GUI elements in Tkinter that allow users to interact with the application using various controls (Labels, Buttons, ComboBoxes, CheckBoxes, MenuBars, etc. RadioButtons, and many others).

Environment Setup

Tkinter is the de facto means to make graphical user interfaces in Python (GUIs). It is included in the Python 3 core; therefore, installing it on Windows or Mac is as straightforward as installing Python 3.x.

If you wish to use the most recent version of Tkinter, you'll need to install a Python version that supports Tcl/Tk 8.5 or higher and Ttk (Tile extension incorporated into Tk), which is required to use the current Tk widget set.

Tkinter Distributions for Python

  • Tkinter is included in popular Python distributions such as ActivePython and Anaconda.
  • Installing Tkinter in a Windows environment is as simple as downloading and installing ActivePython 3.8 or 3.7 from here.
  • Alternatively, you can use Python 3.7 or higher to construct and activate a Conda environment that includes the newest version of Tkinter.

Tkinter Environment Setup

Tkinter (Tk) is the Python default graphical user interface, including the Python installation on Linux, Mac, and Windows. Tk is usually included with most Python installations, so you won't have to install it separately. This step-by-step Tkinter Tutorial will show you how to install it with Python 3 on Windows, Linux, and Mac OS.

Method 1: Installing on macOS

1. Visit https://www.activestate.com/products/activetcl/tcl-tk-modules for more information. The
community can get free downloads from Active State

2. ActiveTcl 8.6 is available for free in the community edition. To download, you may be asked to establish a free account. To proceed, simply enter your email address and create a password.

3. Run the installation program. Before you run the file, you'll need to unpack it from the download folder. Simply drag and drop the app into the Applications directory. When you're finished, you'll have an application named "Wish 8.6" in your Applications folder's Utilities folder.

4. Wish 8.6 is now available. Two windows will be open. The first is called "Console," while the second is called "Wish." In "Console," you can type commands.

5. Type % info patchlevel and press ⏎ Return. You should see something like “8.6.9.” This shows the currently installed version.

Method 2: Installing on Windows

1. Visit https://www.activestate.com/products/activetcl/tcl-tk-modules for more information. Active State offers free downloads to the public, but it also sells programming tools to businesses.

2. ActiveTcl 8.6 is available for free in the community edition. To download, you may be asked to establish a free account. To proceed, simply enter your email address and create a password.

3. Run the installation program. It's usually located in your Downloads folder. If you didn't alter the default location, you'd have a TCL install in C: TCL when you're done.

4. Open the Command Prompt window. This may be done by typing "Cmd" into the Start Menu's search box.

5. Run Wish. The command to start it depends on where you installed Wish.

For example, if you used the default location when you downloaded ActiveTcl from the site, type % C:\Tcl\bin\wish86. Two windows will open. One is titled “Console”, and the other is titled “Wish.”

6. Type % info patchlevel and press ↵ Enter. You should see something like “8.6.9," which is the current installed and running version.

Method 3: Installing on Linux

1. Visit http://www.activestate.com/products/activetcl/tcl-tk-modules/ for more information. Active State offers free downloads to the public, as well as programming tools for businesses.

2. ActiveTcl 8.6 is available for free in the community edition. To download, you may be asked to establish a free account. To proceed, simply enter your email address and create a password.

3. Run the installation program. Before you execute the file, you'll need to unpack it from the download location. Simply drag and drop the app into the Applications directory.


4. Press Ctrl Alt T to open a Terminal window.

5. Type % /opt/ActiveTcl-8.5/bin/wish8.6 to run Wish. A window will pop up titled “Wish 8.6.”

6. Type % info patchlevel and press ↵ Enter. This is to check the version of Wish you are running