-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
43 lines (19 loc) · 963 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
35
36
37
38
39
40
41
42
43
from acess_api import AcessAPI
from util import Utils
class Main:
utils = Utils()
api = AcessAPI()
while(True):
utils.print_menu()
try:
option = int(input('Insira a opção: '))
utils.clear_screen(3)
if option == 1: api.simple_request('https://api.spacexdata.com/v3/launches/next')
elif option == 2: api.simple_request('https://api.spacexdata.com/v3/launches/latest')
elif option == 3: api.tree_request('https://api.spacexdata.com/v3/launches/upcoming')
elif option == 4: api.tree_request('https://api.spacexdata.com/v3/launches/past')
else:
print('Opção invalida. Por favor digite um numero válido(1, 2, 3, 4)')
utils.clear_screen(10)
except ValueError:
print('Erro! Digite apenas o numero da sua opção')