-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
34 lines (28 loc) · 900 Bytes
/
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
import sys
from classes import AppManager
def run_app():
app = AppManager()
print(app.menu)
user_input = input('Enter an option: ')
try:
if int(user_input) == 1:
app.show_top10_imdb()
elif int(user_input) == 2:
app.show_top10_rotten_tomatoes()
elif int(user_input) == 3:
app.show_random_movie()
elif int(user_input) == 4:
app.show_random_movie('imdb')
elif int(user_input) == 5:
app.show_random_movie('rt')
elif int(user_input) == 6:
app.show_movie_each_year()
elif int(user_input) == 7:
app.show_year_count()
elif int(user_input) == 8:
sys.exit()
except ValueError as e:
print('Invalid input, enter a number')
if __name__ == '__main__':
while True:
run_app()