| Jul |
AUG |
Sep |
|
14 |
|
| 2020 |
2021 |
2022 |
About this capture
Organization:
Internet Archive
The Internet Archive discovers and captures web pages through many different web crawls.
At any given time several distinct crawls are running, some for months, and some every day or longer.
View the web archive through the
Wayback Machine.
The Wayback Machine - http://web.archive.org/web/20210814034931/https://wiki.python.org/moin/TkInter
●TkInter
●TkInter
●FrontPage
●RecentChanges
●FindPage
●HelpContents
●TkInter
Page
●Immutable Page
●Info
●Attachments
User
●Login
Tkinter is Python's de-facto standard GUI (Graphical User Interface) package. It is a thin object-oriented layer on top of Tcl/Tk.
Tkinter is not the only GuiProgramming toolkit for Python. It is however the most commonly used one. CameronLaird calls the yearly decision to keep TkInter "one of the minor traditions of the Python world."
Tkinter Documentation
Python GUI with Tkinter is a complete tutorial that covers all the widgets for the Tkinter library, complete with examples.
Thinking in Tkinter is an introduction to some basic Tkinter programming concepts.
TkDocs Tutorial, official Tkinter documentation that covers Python 3+ and Tk8.5, with easy to follow examples.
Graphical User Interfaces with Tk, a chapter from the Python Documentation.
Online Tcl/Tk Manual Pages - the official man pages at the Tcl Developer Xchange.
Tips for Python/Tk by Andreas Balogh (about useful documentation, GUI builders and tips using Grid and HList widgets).
The New Mexico Institute of Mining and Technology created its own Tkinter manual. It is available in HTML and PDF.
The Tkinter Life Preserver, by Matt Conway is still useful, though way out of date. It's the only document that explains how to read the Tcl/Tk manuals and translate the information there to Tkinter calls. HTML version, converted by Ken Manheimer.
The source: when all else fails: Read The Source, Luke!
Other prominent Tcl/Tk sites:
Other Tcl/Tk related links:
Tkinter Extensions
MythDebunking: TkInter is ugly on Windows (http://wiki.tcl.tk/8646)
Checking your Tkinter support
A good way to systematically check whether your Tkinter support is working is the following.
Enter an interactive Python interpreter in a shell on an X console.
Step 1 - can _tkinter be imported?
Try the following command at the Python prompt:
>>> import _tkinter # with underscore, and lowercase 't'
-
If it works, go to step 2.
-
If it fails with "No module named _tkinter", your Python configuration needs to be modified to include this module (which is an extension module implemented in C). Do **not** edit Modules/Setup (it is out of date). You may have to install Tcl and Tk (when using RPM, install the -devel RPMs as well) and/or edit the setup.py script to point to the right locations where Tcl/Tk is installed. If you install Tcl/Tk in the default locations, simply rerunning "make" should build the _tkinter extension.
-
If it fails with an error from the dynamic linker, see above (for Unix, check for a header/library file mismatch; for Windows, check that the TCL/TK DLLs can be found).
Step 2 - can Tkinter be imported?
Try the correct command for your version at the Python prompt:
>>> import Tkinter # no underscore, uppercase 'T' for versions prior to V3.0
>>> import tkinter # no underscore, lowercase 't' for V3.0 and later
-
If it works, go to step 3.
-
If it fails with "No module named Tkinter", your Python configuration need to be changed to include the directory that contains Tkinter.py in its default module search path. You have probably forgotten to define TKPATH in the Modules/Setup file. A temporary workaround would be to find that directory and add it to your PYTHONPATH environment variable. It is the subdirectory named "lib-tk" of the Python library directory (when using Python 1.4 or before, it is named "tkinter").
Step 3 - does Tkinter work?
Try the correct command for your Python version at the Python prompt:
>>> Tkinter._test() # note underscore in _test and uppercase 'T' for versions prior to V3.0
>>> tkinter._test() # note underscore in _test and lowercase 'T' for V3.0 and later
CategoryPyGUI
TkInter (last edited 2021-02-17 11:09:08 by ShadowClaw20017)
Python Powered
GPL licensed
Valid HTML 4.01
Unable to edit the page? See the FrontPage for instructions.