banner



How To Install Tkinter In Ubuntu

Tkinter is a GUI module for python. yous can apply information technology to make GUI based applications in python. Tkinter provides several GUI widgets similar buttons,carte du jour, sheet,text,frame,characterization etc. to develop desktop applications.Though Tkinter is very pop and is included with windows, macosx install of python, There are as well alternative choices like pyQt, wxPython…


In this tutorial we volition see how to install it on linux and employ it with an example.

Showtime, check if you have python installed and also check its version

Open your terminal and type python. if its installed then it will evidence information like version, help… check your version (mine is python 2.7.9)

            aman@vostro:~$ python
Python ii.7.9 (default, April  2 2022, 15:33:21)
[GCC four.9.2] on linux2
Type "assist", "copyright", "credits" or "license" for more data.
>>>

If you don't take python and then install information technology

            sudo apt-get install python          

If you want to install python 3 then enter the following. If you are a newbie, I would recommend python 2 instead of python iii. Python 2 is still very popular and many apps are made on information technology. On ubuntu python2 is still the default

            sudo apt-get install python3          

Finally, Install Tkinter

            sudo apt-become install python-tk          

for python iii

            sudo apt-get install python3-tk          

How to Use it ?


Now, lets bank check if Tkinter is working well with this little example

open your concluding and enter into your python shell.

python

for python3

            python3          

if python was installed correctly you lot will go a >>> prompt.

            aman@vostro:~$ python

Python 2.7.nine (default, Apr  2 2022, xv:33:21)
[GCC 4.9.two] on linux2

Blazon "help", "copyright", "credits" or "license" for more than information.
>>>

Now import Tkinter module. information technology wont evidence any fault if it got imported correctly. Note: Brand certain yous blazon Tkinter (not tkinter) in python2 and tkinter (not Tkinter) in python3.

>>>import Tkinter
>>>

Now, just to check you can create an empty window using Tkinter.

>>>Tkinter.Tk()

to acquire more about Tkinter, you can check out this tutorial on how to make a simple estimator using Tkinter:
http://www.techinfected.cyberspace/2016/02/brand-gui-figurer-in-python-windows-linux.html

Source: https://www.techinfected.net/2015/09/how-to-install-and-use-tkinter-in-ubuntu-debian-linux-mint.html

Posted by: gonsalestheadis.blogspot.com

0 Response to "How To Install Tkinter In Ubuntu"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel