Tkinter (tkinter in Python 3.x) claims to be "most portable GUI toolkit for Python" and is Python's "de-facto standard GUI (Graphical User Interface) package". 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.
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.
For an approach more limited in scope, modify a package.use file for Python only.
Finally, re-emerge the @world set using this command:
emerge --ask -uvDU @world
That is it! Tkinter should now be installed.
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
- When using Python 3.x: use
import tkinter(note the lower case T).
- Python — an extremely popular cross-platform object oriented programming language.