Python Tkinter Hindi – Python Tkinter Tutorial in Hindi

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 Tkinter A to Z

Python Tkinter Tutorial in Hindi

  • 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 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 |

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 |

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 |

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 |

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 |

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 |

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 |

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 |

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 Tutorial in Hindi

Also Read This Post :-

Danish Ali

I Am a Cyber Security Student & I have Skills C, C++, Python, HTML, CSS, PHP, SEO, Computer & Advance Hacking & Blogger & YouTuber.

Published by
Danish Ali

This Website Uses Cookies in order to offer you the most relevant information.Please accept cookies for optimal performance

Read More