Click Here

Introduction to Tkinter

Tkinter is the python module through which we can easily create GUI desktop windows applications .  Tkinter applications also support database connection 

Steps to use GUI programming in Tkinter:

(a) install module Tkinter using pip
(b) import the tkinter module
(c) create the GUI window
(d) add the GUI widget on the screen

import tkinter as tk # import for python 3
# import Tkinter as tk ///import for python 2
root = tk.Tk()
frame = tk.Frame(root)
frame.pack()
root.mainloop()
 

when we run the above code output is as following:

Tkinter widget may be added on the GUI window as per following code 

import tkinter as tk
def myFun():
    print("We will use Tkinter!")
root = tk.Tk()
frame = tk.Frame(root)
frame.pack()
button1 = tk.Button(frame,
                   text="Exit",
                   fg="blue",
                   command=quit)
button1.pack(side=tk.LEFT)
button2 = tk.Button(frame,
                   text="MyButton",
                   command=myFun)
button2.pack(side=tk.LEFT)
root.mainloop()
 

when we run the above code output is as following:

Click Here

Video/ C Introduction

Watch video in full size