-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoffeeApp.py
More file actions
40 lines (34 loc) · 1.19 KB
/
coffeeApp.py
File metadata and controls
40 lines (34 loc) · 1.19 KB
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
# This is the functionality for the menu options. It will keep running until the user selects 'q' or 'Q'
import pprint
import functions
def main():
while True:
print("----------------------------------\n"
" Coffee Inventory App \n"
+"----------------------------------\n"
+ "1 Add coffee item\n"
+ "2 Search coffee products\n"
+ "3 Delete coffee item\n"
+ "4 Update coffee item\n"
+ "5 Import Json file\n"
+ "6 Export Json file\n"
+ "q to quit")
userInput = str(input(">>>"))
if userInput == "1":
functions.addCoffeeItem()
elif userInput == "2":
pprint.pprint(functions.searchCoffee())
elif userInput == "3":
functions.deleteCoffee()
elif userInput == "4":
functions.updateCoffee()
elif userInput == "5":
functions.importJson()
elif userInput == "6":
functions.exportJson()
elif userInput == 'q' or userInput =='Q':
quit()
else:
print("Invaild Option")
if __name__ == '__main__':
main()