Difference between revisions of "What Is Tkinter?"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Importing)
m (000030906 moved page What Is Tkinter? - Python to What Is Tkinter?: changing the way i name these pages)
 
(No difference)

Latest revision as of 10:47, 14 September 2018

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 *