-
Notifications
You must be signed in to change notification settings - Fork 0
/
listgui.py
209 lines (157 loc) · 6.67 KB
/
listgui.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
import os
import pickle
details_list=[]
l2=[]
G = []
def file_save():
NAME_PRO = details_list[0]
ADDRESS_PRO = details_list[1]
MOBILE_NO_PRO = details_list[2]
ROOM_NO_PRO = details_list[3]
PRICE_PRO = details_list[4]
f = open("hotel.dat", "ab")
a=save(NAME_PRO,ADDRESS_PRO,MOBILE_NO_PRO,ROOM_NO_PRO,PRICE_PRO)
pickle.dump(a,f,protocol=2)
f.close()
restart_program()
def restart_program():
"""Restarts the current program.
Note: this function does not return. Any cleanup action (like
saving data) must be done before calling this function."""
python = sys.executable
os.execl(python, python, * sys.argv)
class save:
def __init__(self, NAME_PRO, ADDRESS_PRO, MOBILE_NO_PRO, ROOM_NO_PRO, PRICE_PRO):
self.name=NAME_PRO
self.address=ADDRESS_PRO
self.mobile_no=MOBILE_NO_PRO
self.room_no=ROOM_NO_PRO
self.price=PRICE_PRO
print(self.name,self.address,self.mobile_no,self.room_no,self.price)
import sys
try:
from Tkinter import *
except ImportError:
from tkinter import *
try:
import ttk
py3 = False
except ImportError:
import tkinter.ttk as ttk
py3 = True
class HOTEL_MANGMENT_checkin:
def __init__(self):
root = Tk()
'''This class configures and populates the toplevel window.
top is the toplevel containing window.'''
_bgcolor = '#d9d9d9'
_fgcolor = '#000000'
_compcolor = '#ffffff'
_ana1color = '#ffffff'
_ana2color = '#ffffff'
font11 = "-family {Segoe UI} -size 17 -weight bold -slant " \
"roman -underline 1 -overstrike 0"
font14 = "-family {Times New Roman} -size 16 -weight bold " \
"-slant roman -underline 0 -overstrike 0"
root.geometry("780x541+504+123")
root.title("HOTEL MANAGEMENT")
root.configure(background="black")
root.configure(highlightbackground="#ffffff")
root.configure(highlightcolor="black")
self.Labelframe1 = LabelFrame(root)
self.Labelframe1.place(relx=0.01, rely=0.04, relheight=0.95
, relwidth=0.97)
self.Labelframe1.configure(relief=GROOVE)
self.Labelframe1.configure(font=font11)
self.Labelframe1.configure(foreground="black")
self.Labelframe1.configure(text='''List of Guest Name''')
self.Labelframe1.configure(background="#ffffff")
self.Labelframe1.configure(highlightbackground="#ffffff")
self.Labelframe1.configure(highlightcolor="black")
self.Labelframe1.configure(width=760)
self.Frame1 = Frame(self.Labelframe1)
self.Frame1.place(relx=0.03, rely=0.1, relheight=0.86, relwidth=0.47
, y=-31, h=15)
self.Frame1.configure(relief=GROOVE)
self.Frame1.configure(borderwidth="2")
self.Frame1.configure(relief=GROOVE)
self.Frame1.configure(background="#33ccff")
self.Frame1.configure(highlightbackground="#ffffff")
self.Frame1.configure(highlightcolor="black")
self.Frame1.configure(width=355)
self.Label1 = Label(self.Frame1)
self.Label1.place(relx=0.25, rely=0.040, height=40, width=150)
self.Label1.configure(activebackground="#ffffff")
self.Label1.configure(activeforeground="black")
self.Label1.configure(background="#33ccff")
self.Label1.configure(disabledforeground="#a3a3a3")
self.Label1.configure(font=font11)
self.Label1.configure(foreground="#000000")
self.Label1.configure(highlightbackground="#ffffff")
self.Label1.configure(highlightcolor="black")
self.Label1.configure(text='''Guests Name''')
self.Text1 = Text(self.Frame1)
self.Text1.place(relx=0.06, rely=0.16, relheight=0.8, relwidth=0.88)
self.Text1.configure(background="white")
self.Text1.configure(font=font14)
self.Text1.configure(foreground="#000000")
self.Text1.configure(highlightbackground="#d9d9d9")
self.Text1.configure(highlightcolor="black")
self.Text1.configure(insertbackground="black")
self.Text1.configure(selectbackground="#c4c4c4")
self.Text1.configure(selectforeground="black")
self.Text1.configure(width=314)
self.Text1.configure(wrap=WORD)
self.Frame2 = Frame(self.Labelframe1)
self.Frame2.place(relx=0.51, rely=0.1, relheight=0.86, relwidth=0.47
, y=-31, h=15)
self.Frame2.configure(relief=GROOVE)
self.Frame2.configure(borderwidth="2")
self.Frame2.configure(relief=GROOVE)
self.Frame2.configure(background="#33ccff")
self.Frame2.configure(highlightbackground="#ffffff")
self.Frame2.configure(highlightcolor="black")
self.Frame2.configure(width=355)
self.Label2 = Label(self.Frame2)
self.Label2.place(relx=0.30, rely=0.02, height=44, width=160)
self.Label2.configure(activebackground="#ffffff")
self.Label2.configure(activeforeground="black")
self.Label2.configure(background="#33ccff")
self.Label2.configure(disabledforeground="#a3a3a3")
self.Label2.configure(font=font11)
self.Label2.configure(foreground="#000000")
self.Label2.configure(highlightbackground="#ffffff")
self.Label2.configure(highlightcolor="black")
self.Label2.configure(text='''Room Number.''')
self.Text2 = Text(self.Frame2)
self.Text2.place(relx=0.06, rely=0.16, relheight=0.8, relwidth=0.88)
self.Text2.configure(background="white")
self.Text2.configure(font=font14)
self.Text2.configure(foreground="black")
self.Text2.configure(highlightbackground="#d9d9d9")
self.Text2.configure(highlightcolor="black")
self.Text2.configure(insertbackground="black")
self.Text2.configure(selectbackground="#c4c4c4")
self.Text2.configure(selectforeground="black")
self.Text2.configure(width=314)
self.Text2.configure(wrap=WORD)
for i in range(0,len(G)):
s=str(l2[i])
h=str(G[i])
self.Text1.insert(INSERT,s+"\n")
self.Text2.insert(INSERT,h+"\n")
root.mainloop()
if __name__ == '__main__':
f2 = open("hotel.dat", "rb")
try:
while True:
s = pickle.load(f2)
k = s.room_no
o = s.name.upper()
l2.append(o)
G.append(k)
continue
except EOFError:
pass
f2.close()
hotel=HOTEL_MANGMENT_checkin()