tkinter

suggest change

Introduction

Released in Tkinter is Python’s most popular GUI (Graphical User Interface) library. This topic explains proper usage of this library and its features.

Remarks

The capitalization of the tkinter module is different between Python 2 and 3. For Python 2 use the following:

from Tkinter import *  # Capitalized

For Python 3 use the following:

from tkinter import *  # Lowercase

For code that works with both Python 2 and 3, you can either do

try:
    from Tkinter import *
except ImportError:
    from tkinter import *

or

from sys import version_info
if version_info.major == 2:
    from Tkinter import *
elif version_info.major == 3:
    from tkinter import *
See the tkinter Documentation for more details

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents