-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRailwaySystem.py
More file actions
32 lines (31 loc) · 975 Bytes
/
RailwaySystem.py
File metadata and controls
32 lines (31 loc) · 975 Bytes
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
from RailwaySystemModule import railClass
import maskpass
def console_menu():
object=railClass(input("\nEnter MYSQL Server's Username: "),maskpass.askpass("\nEnter MYSQL Server's Password: "))
while True:
print('''
***** WELCOME *****
Menu:
1. View all available Trains
2. View Train Timetable
3. Reserve Tikets
4. Exit System
''')
try:
response = int(input("Enter your choice: "))
if response == 1:
object.display_train_info()
pass
elif response == 2:
object.time_table()
pass
elif response == 3:
object.ticket_reservation()
pass
elif response == 4:
break # stops loop
else:
print("Invalid Choice! Try Again")
except Exception:
print("Something went wrong! Try Again")
console_menu()