python GUI - tkinter

Python GUI: tkinter

python has gui support also, provided via tkinter package. "tkinter" pkg just provides an i/f to Tcl/Tk gui, so all cmds from Tcl/Tk can be used to create gui. It is avilable for both python2 and python3, though name of package changes slightly (In python 2, it's named Tkinter (capital T), while in python3, it's named tkinter (small t). The majority of its standard library is provided in the python*-libs package, which should be installed automatically along with python* executable (in /usr/lib64/python*/ dir). python-tkinter which is the gui lib, is not installed by default, as it's big. So, we need to install it separately.

sudo yum install python36-tkinter => this installs tkinter for python3.6. I was constantly getting dependency errors while downloading tkinter for python34, so I chose to install and download python36 and python36-tkinter.

After installation, check to see if it got installed correctly. Type these 2 cmds. python2 will give an error for tkinter, while python3 will bring up a new box.

python -m tkinter => shows error msg => /usr/bin/python: No module named tkinter. This is because we didn't install tkinter for python2
python3 -m tkinter => brings up a new box which shows "Tcl/Tk version 8.5"