Create Sign Up Form using Python TKinter - Programming Ka Keeda

Create Sign Up Form using Python TKinter

Create Sign Up Form using Python TKinter

Hello Friends! Yahan hum tkinter library ka use karke ek simple GUI (Graphical User Interface) “Create Sign Up Form using Python TKinter” window banaane wale code ko Hinglish mein samjhate hain:

from tkinter import *: Is line se hum tkinter library ko import karte hain aur isse hum tkinter ki sabhi classes aur functions ko seedha use kar sakte hain bina tk. naamak space ka use kiye.

root = Tk(): Yahaan, hum ek mukhya window (root window) bana rahe hain. Tk() ek function hai jo ek naya tkinter window banata hai.

label = Label(root, text="Sign up"): Is line mein hum ek label banate hain jise "Sign up" ke saath root window mein dikhana hai. Label() function label ko banata hai.

root.mainloop(): Yeh line tkinter ka mukhya loop ko shuru karta hai. Is loop ke madhyam se GUI window user ke interactions ka jawab deta hai aur usko jeevit rakhta hai.

Is code ko ek Python script mein daal kar chala sakte hain, aur aapke samne ek sadharan tkinter Sign up form ka window khul kar ayega jisme "Sign up" likha hoga aur Sign up ka full form ayega.
Yad rahe ki code ko sahi se chalane ke liye aapke system mein Python installed hona chahiye, kyun ki tkinter aam taur par Python ke standard library mein aata hai.

Full Code:- Create Sign Up Form using Python TKinter

from tkinter import *
# from tkinter import messagebox
# import ast

window=Tk()
window.title("SignUp")
window.geometry('540x500')
window.configure(bg='#fff')
window.resizable(False,False)


frame=Frame(window,width=350,height=390,bg='#fff')
frame.place(x=90, y=50)

heading=Label(frame,text='Sign up', fg="#57a1f8", bg='white', font=('Microsoft Yahei UI Light',23,'bold'))
heading.place(x=100, y=5)


######....................................
def on_enter(e):
    user.delete(0,'end')
def on_leave(e):
    if user.get()=='':
        user.insert(0,'Username')    

user=Entry(frame,width=25,fg='black',border=0,bg='white',font=('Microsoft Yahei UI Light',11))
user.place(x=30,y=80)
user.insert(0, 'Username')
user.bind("<FocusIn>",on_enter)
user.bind("<FocusOut>",on_leave)

Frame(frame,width=295,height=2,bg='black').place(x=25,y=107)


######....................................
def on_enter(e):
    code.delete(0,'end')
def on_leave(e):
    if code.get()=='':
        code.insert(0,'Password')    

code=Entry(frame,width=25,fg='black',border=0,bg='white',font=('Microsoft Yahei UI Light',11))
code.place(x=30,y=150)
code.insert(0, 'Password')
code.bind("<FocusIn>",on_enter)
code.bind("<FocusOut>",on_leave)

Frame(frame,width=295,height=2,bg='black').place(x=25,y=177)


######....................................
def on_enter(e):
    conform_code.delete(0,'end')
def on_leave(e):
    if conform_code.get()=='':
        conform_code.insert(0,'Conform Password')    

conform_code=Entry(frame,width=25,fg='black',border=0,bg='white',font=('Microsoft Yahei UI Light',11))
conform_code.place(x=30,y=220)
conform_code.insert(0, 'Conform Password')
conform_code.bind("<FocusIn>",on_enter)
conform_code.bind("<FocusOut>",on_leave)

Frame(frame,width=295,height=2,bg='black').place(x=25,y=247)


###.......................................
Button(frame,width=39,pady=7,text='Sign up',bg='#57a1f8',fg='white',border=0).place(x=35,y=280)
label=Label(frame,text='I have an account',fg='black',bg='white',font=('Microsoft Yahei UI Light',9))
label.place(x=90,y=340)

signin=Button(frame,width=6,text='Sign in',border=0,bg='white',cursor='hand2',fg='#57a1f8')
signin.place(x=200,y=340)


window.mainloop()

Output:-

Create Sign Up Form using Python TKinter

Humari Website:- programming ka keeda me aane k liye apka bahut-bahut Dhanyawaad!😊

एक टिप्पणी भेजें

0 टिप्पणियाँ
* Please Don't Spam Here. All the Comments are Reviewed by Admin.