-
Notifications
You must be signed in to change notification settings - Fork 0
/
room_check_for_restaurant.py
71 lines (58 loc) · 2.17 KB
/
room_check_for_restaurant.py
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from tkinter import *
from subprocess import call
import sys
def guest_name(event):
import csv
with open("guest_list.csv","r") as f:
gs=e1.get()
gst=csv.reader(f)
for row in gst:
if row==[]:
no_data=Label(root,text="NO DATA PRESENT")
no_data.place()
pass
elif row[4]==gs:
gst_name=row[0]
label=Label(root,text="WELCOME: ",font="times 18 bold")
label.place(x=100,y=150)
label2=Label(root,text=gst_name,font="times 18 bold")
label2.place(x=250,y=150)
enter=Button(root,text="ENTER RESTAURANT",font="times 12 bold",command=call_restaurant)
enter.place(x=160,y=185)
break
else:
room_not_match=Label(root,text="ROOM NO. DOES NOT EXIST",font="times 18 bold")
room_not_match.place(x=100,y=150)
def call_restaurant():
call(["python","restaurant.py"])
#def check_room():
# import os
# import csv
# with open("guest_list.csv","r") as f:
# gs=e1.get()
# gst=csv.reader(f)
# for row in gst:
# if row==[]:
# pass
# elif row[4]==gs:
# call(["python","restaurent.py"])
# break
#else:
# mylabel2=Label(root,text="room no. does not exist",font="Courier 15")
# mylabel2.pack()
root = Tk()
root.iconbitmap('hotel.ico')
root.geometry('500x300')
root.title('CHECKING ROOM NO')
mylabelmain=Label(root,text="TO CHECK WHETHER ROOM NO EXIST",font="Courier 20 bold")
mylabelmain.place(x=0,y=15)
mylabel=Label(root,text="ENTER ROOM NO:",font="Courier 15")
mylabel.place(x=170,y=50)
e1=Entry(root,width=25)
e1.place(x=170,y=80)
e1.bind('<Return>',guest_name)
#button2=Button(root,text="OK",font="Courier 11 bold",command=guest_name('<Return>'))
#button2.place(x=335,y=75)
button1=Button(root,text='Cancel',font="Courier 12",command=root.destroy)
button1.place(x=210,y=110)
root.mainloop()