Introduction of the Tkinter in python by R4R Team

-Tkinter is the standard GUI library for Python.

What is GUI-

-GUI stands for the Graphical user interface.
-It is a user friendly interface so that a human being can easily understand the Things in Computer Machine.
-C programming not provide efficient way of using GUI program, it supports the canvas programming.

Python Tkinter Supports GUI and canvas programming.

Following steps are the creating for the GUI by tkinter-

1.Import the Tkinter module.

2.Create the GUI application main window.

3.Add one or more of the above-mentioned widgets to the GUI application.

4.Enter the main event loop to take action against each event triggered by the user.

Widget in Tkinter-

Button : This widget is used to create a button on the window
Canvas : This widget is used to draw a canvas structure like circle, line, rectangle etc.
Entry : This wigdet is used to Display a single line text field taking input from the user.
Label : This widget is used to display the text on the window screen.
Menu : This widget is used to create a menu button.
Checkbutton : This widget is used to create a checkbuttons on the screen, which take either True or False value.
Text " This widget is similar as the Entry widget, but Text widget field is large as they take more data from the user.
Radiobutton : This widget is create a radio button on the screen. The user can select one option in all radio buttons at a time.

How to Install tkinter In python-

-Write 'import tkinter' in your program,if program execute without any error then Tkinter is already install in your python.
-if it will give an error then Install tkinter in following steps-

1. Goto the search icon in your computer.
2. search cmd(command promt)
3. Then write the following command in the cmd

pip install tkinter

4. Goto your program and execute again it will not give an error this time.

Import The Tkinter in your program


#first way
import tkinter

#second way
from tkinter import *

-In this program, by the first way we import the tkinter module and when we want to call any method of tkinter module by tkinter.widget()
-while in second we import everything from the tkinter, where * shows the everything.

Leave a Comment:
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!