Tkinter
Tkinter (tkinter in Python 3.x) claims to be "most portable GUI toolkit for Python"[1] and is Python's "de-facto standard GUI (Graphical User Interface) package"[2]. Although there are several other graphical toolkits for Python, Tkinter is the one most often used in GUI development with Python.
tkinter uses dev-lang/tk internally.
Installation
make.conf
Getting Tkinter can be accomplished by enabling the tk
USE flag. This can be set for specifically for Python, or for all packages system-wide in the make.conf file.
USE="tk"
package.use
For an approach more limited in scope, modify a package.use file for Python only.
dev-lang/python tk
Emerge
Finally, re-emerge the @world set using this command:
root #
emerge --ask -uvDU @world
That is it! Tkinter should now be installed.
Usage
When attempting to use Tkinter in Python code, depending on the version(s) of Python are currently installed on the system, import Tkinter might need performed in different ways:
- When using Python 2.x.: use
import Tkinter
- When using Python 3.x: use
import tkinter
(note the lower case T).
See also
- Python — an extremely popular cross-platform object oriented programming language.