-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
executable file
·62 lines (40 loc) · 1.41 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
#!/usr/bin/python3
from utils import db
import menus
import DML
def main():
# Nom de la BD à créer
db_file = "data/hiketIt.db"
# Créer une connexion a la BD
conn = db.creer_connexion(db_file)
# Remplir la BD
print("1.We create 'hikeIt' DB and feed it with some data")
print("")
db.mise_a_jour_bd(conn, "data/hiketIt_creation.sql")
print("TABLES CREATED SUCCESSFULLY !")
print("")
db.mise_a_jour_bd(conn, "data/hiketIt_insert_ok.sql")
# START USER INTERFACE INTERACTION WITH OUR DB:
while (True):
print("*********Main menu **********")
print("1- INSERT REQUESTS")
print("2- UPDATE REQUESTS")
print("3 -SELECT REQUESTS")
print("4 -DELETE REQUESTS")
print("5 -QUIT")
print("")
option=int(input("Enter option: "))
if(option==5): #QUIT MAIN MENU
break
elif (option==1): #INSERT REQUESTS FROM MAIN MENU
menus.insertMenu(conn)
elif (option==2): #UPDATE REQUESTS FROM MAIN MENU
menus.updateMenu(conn)
elif (option==3): #SELECT REQUESTS FROM MAIN MENU
menus.selectMenu(conn)
elif (option==4): #DELETE REQUESTS FROM MAIN MENU
menus.deleteMenu(conn)
else:
print("Ouups,option not mentionned in main menu!")
if __name__ == "__main__":
main()