What Is Tkinter?

From TRCCompSci - AQA Computer Science
Revision as of 10:47, 14 September 2018 by 000030906 (talk | contribs) (000030906 moved page What Is Tkinter? - Python to What Is Tkinter?: changing the way i name these pages)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Tkinter module is the standard Python interface to the Tk GUI toolkit. It's one of the most popular GUI toolkits to use in Python, and is installed by default when you install Python on most platforms.

You can test if Tkinter is properly installed on your system by running "python -m Tkinter" from the the command line. This should open a window demonstrating a simple Tk interface, letting you know it's installed and working. (It'll also show you which version is installed so you can refer to documentation specific to your version.)

Importing

As with any Python module, when working with Tkinter, you must first import the library, which is simply done by the following line of code;

from tkinter import *