what is tkinter in python?

Last updated:6/27/2018 3:41:01 AM

1 Answers

Prakash nidhi Verma
Prakash nidhi Verma

- Tkinter is a lib for designing GUI in python.

- Import the Tkinter module. Create the GUI application in main window. 

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

Syntax :

import tkinter 
top = tkinter.Tk()

Example for adding any text with a button :

from tkinter import* 
from tkinter ttk
root = Tk()
label (root,text='Hello!').pack()
button= ttk.Button(root,text='click me')
def callback():
root.main loop()