-
Notifications
You must be signed in to change notification settings - Fork 63
/
Main.py
62 lines (53 loc) · 1.55 KB
/
Main.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
# This is the Main File that loads all the Other Modules
# Importing Required Modules
import core.User_Functions as User
import core.Other as Other
import core.Checks as Check
from time import sleep
# Initial Checks
# Checking the Connection to the MySQL Server
connection_status = Check.CheckConnection()
if connection_status is False:
quit()
else:
Check.CheckDatabase() # Checking for the Requirements of the Project
Other.ClearScreen() # Clear the Terminal Window
# Final Imports
# Ask for the Input and Process it
Other.Menu()
while True:
ans = input("Choose an Option Number: ")
if ans == "1":
User.BookTrain()
elif ans == "2":
User.CancelBooking()
elif ans == "3":
User.CheckFare()
elif ans == "4":
User.ShowBookings()
elif ans == "5":
User.AvailableTrains()
elif ans == "6":
Other.ClearScreen()
Other.Menu()
elif ans == "7":
Other.Menu()
elif ans == "8":
Other.ClearScreen()
Other.About()
while True:
ask = input("Do you want to Display Menu(Y/N): ")
if ask in ["Y", "y"]:
Other.Menu()
break
elif ask in ["N", "n"]:
break
else:
print("Please Enter either Y (Yes) or N (No)!")
elif ans == "9":
print("Closing all Connections..")
sleep(0.5)
print("Thank You!")
quit()
else:
print("Please Enter a Valid Option Number!")