Python Tkinter Tutorial in Hindi

Python Tkinter Hindi – Python Tkinter Tutorial in Hindi

Python

Python Tkinter :- Tkinter Python Ko Aaj Ham A to Z Samanjh Ne Wale Hai Or Ham Tkinter GUI Application Bhi Banane Wale Hai Me Is Post Me A to Z Tkinter Function ko Cover Karunga Jiske Bad Aapke Sare Tkinter Doubt Clear Ho Jayenge |

Also Read :- Python Full Tkinter In HIndi

Python Tkinter Tutorial in Hindi

Contents

  • Introduction to Python Tkinter in Hindi
  • Import Tkinter Python in Hindi 
  • Working with Tkinter Project in Hindi

Introduction to Python Tkinter

Python Tkinter Ek PowerFul Gui Banane Wala Module Hai Jis se ham GUI Application Bana Sakte Hai Python Tkinter se Bahut Se Bade Bade GUI Application Banaye Gye Hai Or Iski Sabse Acchi Baat Ye Hai Ki Ye Bahut Easy hai Jise Ham Bilkul Aashan Tarike Se Learn Kar Sakte Hai |

Python Tkinter Tutorial in Hindi

Python Tkinter Ko Understand Karne Ke liye Ham Step By Step Follow Karenge |

Step 1: Sabse Pahle Aapko Pycharm Ko Download Karna Hoga Agar Aapke Pas Pycharm Software Nhi Hai to Niche Diye Link Par Jakar Pycharm Download Kar Sakte Hai |

PyCharm LinkPython setup

Step 2: Fir Uske Bad Aapko Python Ko Download Karna Hoga Agar Aapne Python download nhi kiya hai To Aap Niche Diye Link Par Click Karke Python Download Kar Sakte Hai |

Python LinkDownload Now

Step 3: Ab Aapko Pycharm Ko Open Karna Hoga Or Fir Aapko Python Tkinter Ko Import Karna Hoga |

import tkinter as tk
from tkinter import ttk

Upper Diye Gye Code Me Hamne tkinter Ko import kiya hai |Uske Bad Ham Tkinter Python ko Istemal Kar Sakte Hai |

Step 4: Import Karne Ke Bad Ab Hame object ka name or fir hame tkinter loop ko closed karna hoga |

import tkinter as tk
from tkinter import ttk

win = tk.Tk()

win.mainloop()

Aap Code Ko Dekh Sakte Hai Hamne Sabse Pahle tkinter Ko Import Kiya Or Fir Hamne ek object win Name banaya hai ye hamne isliye banaya hai taki ham bar bar tk.Tk() na likh kar keval win likh sikhe isse ham program aashan ho jata hai | uske bad hamne win.mainloop() ko closed kiya hai iska matlab hai ki jo bhi ham program write karenge to ham iske under hi karenge |

win.mainloop() ka work hota hai ki jab tak mouse se GUI ko closed nhi kiya jaye tab tak ye bar bar chalti rahegi ye ek loop hoti hai |

Python Tkinter Tutorial in Hindi

Abhi Tak Jo Hamne Code Likha Hai Usse Keval Ye Gui Application bani hai |

Step 5: Ab Ham Aapni GUI ka Name Change Karte Hai Uske liye hamne pyhton tkinter title function ka istemal karna hoga |

Python Tkinter Tutorial

Aap Upper Diye Image ko Dekh Sakte Hai Hamne win.title ka istemal karke apni application ka name change kar diya hai |

Python Tkinter Function In Hindi

Step 6: Ab Ham Python Tkinter me kuch or function ka istemal karte hai jese|

  • Title :- Title Ka matlab hai GUI ka Title Kiya Dena Hai |
  • Configure :- Configure Matlab background ko configure karna |
  • Geometry :- Iska Matlab Hai ki GUI Ka Size Kitna Rakhna Hai – Jab GUI Open Ho |
  • Maxsize :- Iska Matlab Hai Ki GUI Max Size Kitna Rakhna Hai |
  • Minsize :- Iska Matlab Hai Ki GUI Min Size Kitna Rakhna Hai |
  • Iiconbitmap :- Iska Matlab Hai GUI me Icon ko add Karna |
python-tkinter-3

Aap Upper Diye Gye Image ko dekh Sakte Hai Hamne Sare Function apply karke iska ek simple GUI application bana liya hai |

Python tkinter Label function

Step 7: Ab Ham kuch or advance ki taraf chal rhe or iske or function ko dekhte hai jese |

In function Ko istemal karne se pahle aapko ye import karna hoga |

from tkinter import *
  • Label :- Label Ka matlab hai ki ham kuch bhi likh kar Add kar Sake |
  • Grid :- Grid Ka Matlab hai ki ham kis row or cloumn me add karna hai
  • pack :- Pack Ka Matlab hai ki keval add kar do lekin kaha par karna hai ye pta nhi hota hai |
  • sticky :- sticky ka matlab hai ki hame jo bhi add karna hai Wo NORTH (N) YA SOUTH (S), WEST (W) , EAST (E) me karna hai |
python-tkinter-4

Aap Dekh Sakte hai hamne label bana ke uske under pahle win pass kiya or fir hamne window par My Application Display karana hai or fg matlab for groud color red diya hai or grid ka istemal karke use jahan par rakhna tha wha par hamne row or column de diya hai or sticky ko West (W) Rakha hai |

Ab Ham Or Kuch Or Label Add Karte Hai Taki Ham Ek Accha Sa Calculator Bhi Bana Sake Learn karte Hue |

python-tkinter-5

Aap Dekh Sakte Hai Hamne Or bhi Leval Add Kar Diye Hai |

Python tkinter Entry function

Step 9: Ab Ham Aapne GUI application me ENTRY BOX bhi add karte hai | entry box ka matlab hai ki ham entry karaye user se |

python-tkinter-6

Ab Dekh hamne entry box bhi add kara diya hai aap image ko dekh kar samnajh sakte hai hai |

Python tkinter Button function

Step 10: Ab Ham Python Tkinter Gui Application me BUTTON bhi add karte hai |

B=Button(win, text ="Submit",command = process,bg='yellow').grid(row=5,column=1,)

ye button ko add karne ka coe hai aap isse istemal kar sakte hai |

python-tkinter-7

Ab Dekh Sakte Hai Hamne Button bhi add kar DIya Hai |

Hamne Ek Calculator bana liya hai or hamne keval iska design banaya hai lekin abhi ye work nhi karenga kyoki hame iske liye main coding karni padegi jisse ham add , Mul , DIv , Subs kar sakte hai |

Step 11: Ab Ham Iski Main Coding karte hai jisse ham calculator ka work kar sakte hai |

python-tkinter-7

Aap Dekh Sakte hai hamne iski main coding kardi hai ab aap is calculator ko istemal kar sakte hai | agar aapko kuch problem aa rhi hai to aap niche diye gye code ko dekh sakte hai or aapi problem solve kar sakte hai |

Python Calculator Full Coding

from tkinter import *
import tkinter as tk
from tkinter import ttk


# main coding start

def process():
    number1=Entry.get(E1)
    number2=Entry.get(E2)
    operator=Entry.get(E3)
    number1=int(number1)
    number2=int(number2)
    if operator =="+":
        answer=number1+number2
    if operator =="-":
        answer=number1-number2
    if operator=="*":
        answer=number1*number2
    if operator=="/":
        answer=number1/number2
    Entry.insert(E4,0,answer)
    print(answer)

# main coding end  

# design coding start

win = tk.Tk()

win.title("My Application") 
win.geometry('250x250') 
win.iconbitmap('icon.ico')
win.configure(bg='red')
win.maxsize(width=250,height=180)
win.minsize(width=250,height=180)




l= Label(win,text='My Application',fg='red').grid(row=0,column=1,sticky=W)
ll= Label(win,text='-----------------------',fg='red').grid(row=1,column=0,sticky=W)
l1=Label(win,text='First Number',).grid(row=2,column=0,sticky=W)
l2=Label(win,text='Second Number',).grid(row=3,column=0,sticky=W)
l3=Label(win,text='Opeartor',).grid(row=4,column=0,sticky=W)
l4=Label(win,text='Answer',).grid(row=5,column=0,sticky=W)

E1= Entry(win,bd=5)
E1.grid(row=2,column=1)
E2= Entry(win,bd=5)
E2.grid(row=3,column=1)
E3= Entry(win,bd=5)
E3.grid(row=4,column=1)
E4= Entry(win,bd=5)
E4.grid(row=5,column=1)




B=Button(win, text ="Submit",command = process,bg='yellow').grid(row=6,column=1,)

# design coding end

   
win.mainloop()

Output :-

python tkinter calculator

Python Tkinter Tutorial in Hindi

Also Read This Post :-

Agar Aap A to Z Full Tkinter Tutorial Ko Learn Karna Chahte Hai To Aap Niche Di Gayi Video Ko Dekh Sakte Hai |

10 thoughts on “Python Tkinter Hindi – Python Tkinter Tutorial in Hindi

  1. win.iconbitmap(‘icon.ico’)

    ye code run nai ho raha hai mere me

    Error Displayed:

    Traceback (most recent call last):
    File “D:\PythonProject\Python with selenium\PracticePurpose\BasicProgramofTkinter.py”, line 34, in
    win.iconbitmap(‘icon.ico’)
    File “C:\Users\AKASH\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py”, line 2080, in wm_iconbitmap
    return self.tk.call(‘wm’, ‘iconbitmap’, self._w, bitmap)
    _tkinter.TclError: bitmap “icon.ico” not defined

      1. ye same prob mere sath bhi h n i did copy icon to the working directory but still having problem….
        mujhe icon lagana hai or icon.ico file hi hai or directory me bhi h….
        sorry, not giving my real mail, but i ll wait for your answer and will check here…

        1. kyuki ye sir ne apne file ka name icon rakha jho ki aapke k image ka name alag or wo apke folder me bhi nahi honga isliye ye error aa rha hai.

      2. ye same prob mere sath bhi h n i did copy icon to the working directory but still having problem….
        mujhe icon lagana hai or icon.ico file hi hai or directory me bhi h….
        sorry, not giving my real mail, but i ll wait for your answer and will check here…

        one more thing, i need the code of the other softwares you made like whatsapp message sender without saving number, and others…you said you ll give the code in description but there wasnt any…kindly mention the code here…..

        1. App ko pura path likhna hai, jidhar aapki file rakhi hu hai.
          like mere file “hospital.ico” download folder mei rakhi hu hai.
          win.iconbitmap(‘C:/Users/Ranvijay_Reeya/Downloads/hospital.ico’)

  2. Sir Aap bahut hi badi seva kar rahe hein agar inki pdf complete course ke bhi de dein to bahut kripa hogi

  3. from tkinter import*
    T=Tk()
    T.title(“Notepad”)
    T.geometry(‘800×600′)
    T.configure(bg=’black’)
    lbl=Label(T,text=’First number:-‘,bg=’yellow’).place(x=0,y=10)
    lbl=Label(T,text=’Second number:-‘,bg=’yellow’).place(x=0,y=40)
    lbl=Label(T,text=’Operator:-‘,bg=’yellow’).place(x=0,y=70)
    lbl=Label(T,text=’Answer:-‘,bg=’yellow’).place(x=0,y=100)
    ent1=Entry(T,bd=5,bg=’pink’).place(x=110,y=8)
    ent2=Entry(T,bd=5,bg=’pink’).place(x=110,y=40)
    ent3=Entry(T,bd=5,bg=’pink’).place(x=110,y=70)
    ent4=Entry(T,bd=5,bg=’pink’).place(x=110,y=100)
    Btn=Button(T,text=’Submit’,bg=’green’,bd=6,command=’process’).place(x=0,y=200)
    def process():
    Num1=Entry.get(ent1)
    Num2=Entry.get(ent2)
    Num3=Entry.get(ent3)
    Number1=int(Num1)
    Number2=int(Num2)
    if Num3 ==”+”:
    Answer=Number1+Number2
    Entry.insert(ent4,0,Answer)
    print(‘Answer’)

Leave a Reply

Your email address will not be published. Required fields are marked *