0
2.0kviews
Write a Python Program to create GUI for student registration form. (Registration form should include name, id ,gender, e-mail id. Contact no., submit button)
1 Answer
2
101views

Code:-

from tkinter import *
m = Tk() 
m.title("student's login") 

var=StringVar()
m.geometry("500x600")

Label(m, text='loin').grid(row=1)

Label(m, text='First Name').grid(row=1)
Label(m, text='Id No').grid(row=2)

#radiobutoon
Label(m, text='Gender').grid(row=3)
v = IntVar() 
Radiobutton(m,text='Male',  variable=v,value=1).grid(row=3,column=1,sticky=W)
Radiobutton(m,text='Female',variable=v,value=2).grid(row=4,column=1,sticky=W) 

Label(m, text='Phone no').grid(row=5)
Label(m, text='Email.id').grid(row=6)

e1=Entry(m)
e2=Entry(m)
e3=Entry(m)
e4=Entry(m)

e1.grid(row=1,column=1)
e2.grid(row=2,column=1)
e3.grid(row=5,column=1)
e4.grid(row=6,column=1)

#checkbox
Label(m, text='Course').grid(row=7)
var1= IntVar() 
Checkbutton(m, text='Java', variable=var1).grid(row=7,column=1, sticky=W) 
var2= IntVar() 
Checkbutton(m, text='Python', variable=var2).grid(row=8,column=1, sticky=W)
var3= IntVar() 
Checkbutton(m, text='HTML', variable=var3).grid(row=9,column=1, sticky=W)
var4= IntVar() 
Checkbutton(m, text='PHP', variable=var4).grid(row=10,column=1, sticky=W)
#list box(couse)

m.mainloop()

Output:-

enter image description here

Please log in to add an answer.