-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram_10.py
More file actions
53 lines (44 loc) · 1.47 KB
/
program_10.py
File metadata and controls
53 lines (44 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from tkinter import *
root=Tk()
def getvals():
print("its work")
root.geometry('656x500')
#heading
Label(root,text='welcome to bhavya lapi',font='comicsansms 13 bold',pady=15).grid(row=0,column=3)
#text for our form
name=Label(root,text='Name')
phone=Label(root,text='Phone')
gender=Label(root,text='Gender')
emergency=Label(root,text='Emergency Contact')
paymentmode=Label(root,text='Payment Mode')
#pack text for our form
name.grid(row=1,column=2)
phone.grid(row=2,column=2)
gender.grid(row=3,column=2)
emergency.grid(row=4,column=2)
paymentmode.grid(row=5,column=2)
#tkinter variable for storing entries
namevalue=StringVar()
phonevalue=StringVar()
gendervalue=StringVar()
emergencyvalue=StringVar()
paymentmodevalue=StringVar()
foodservicevalue=IntVar()
#entries for a form
nameentry=Entry(root,textvariable=namevalue)
phoneentry=Entry(root,textvariable=phonevalue)
genderentry=Entry(root,textvariable=gendervalue)
emergencyentry=Entry(root,textvariable=emergencyvalue)
paymentmodeentry=Entry(root,textvariable=paymentmodevalue)
#packing the entries
nameentry.grid(row=1,column=3)
phoneentry.grid(row=2,column=3)
genderentry.grid(row=3,column=3)
emergencyentry.grid(row=4,column=3)
paymentmodeentry.grid(row=5,column=3)
#check box and packing it
foodservice=Checkbutton(text="want to prebook your meals",variable=foodservicevalue)
foodservice.grid(row=6,column=3)
#button and packing it and assigning it a command
Button(text='submit',command=getvals).grid(row=7,column=3)
root.mainloop()