-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
134 lines (106 loc) · 4.18 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
from pystyle import Colorate, Colors, Center, System, Anime
from sys import platform
from data.Ships import ships_requests
from data.capsules import capsules_requests
from data.history import history_requests
from data.landingpads import landspad_requests
from data.missions import missions_requests
from data.payloads import payloads_requests
from data.roadster import roadsters_requests
from data.spacex import info_spacex
from data.rockets import rockets_requests
from data.cores import cores_requests
# https://api.spacexdata.com/v3
logo = """ -- __
~ (@) ~~~---_
{ `-_~,,,,,,)
{ (_ ',
~ . = _',
~ '. =-'
~ :
. -~ ('');
'. --~ \ \ ;
'.-_ -~ \ \; _-=,.
-~- _ -~ { '---- _'-=,.
~- _~- _ _ -~ ~---------=,.`
~- ~~-----~~~~~~ .+++~~~~~~~~-__ /
~- __ { - + } /
~- ______{_ _ -=\ / /_ ~
: ~--~ // / ..-
: / / // / ((
: / / { `-------,. ))
: / ''=--------. }o
.=._________,' ) ))
) _________ -'' ~~
/ / _ _
(_.-.'O'-'.
By Kijusu#2614 | IG : _maxence26
"""
def initialization():
System.Size(180, 50)
System.Title("SpaceX")
Anime.Fade(text=Center.Center(logo), color=Colors.purple_to_blue, mode=Colorate.Vertical, enter=True)
def title():
title_text = """
________ _______ __ ______ _______ ___ ___
/" )| __ "\ /""\ /" _ "\ /" "||" \/" |
(: \___/ (. |__) :) / \ (: ( \___)(: ______) \ \ /
\___ \ |: ____/ /' /\ \ \/ \ \/ | \\ \/
__/ \\ (| / // __' \ // \ _ // ___)_ /\. \
/" \ :)/|__/ \ / / \\ \(: _) \ (: "| / \ \
(_______/(_______)(___/ \___)\_______) \_______)|___/\___|
- 1 : Look Capsules - 6 : Info SpaceX
- 2 : Look Rockets - 7 : Look Cores
- 3 : Look Roadsters - 8 : Look Ships
- 4 : Look Payloads - 9 : Look Missions
- 5 : Look Landing Pads - 10 : Look History
- 11 : Exit
"""
print(Colorate.Horizontal(Colors.purple_to_blue, Center.XCenter(title_text)))
def switch(number, system):
numbers = {
1: capsules_requests,
2: rockets_requests,
3: roadsters_requests,
4: payloads_requests,
5: landspad_requests,
6: info_spacex,
7: cores_requests,
8: ships_requests,
9: missions_requests,
10: history_requests,
11: exit,
}
clearScreen(system)
title()
numbers.get(number)()
yes_or_no = input("Exit ? ( Y - N ) -> ")
if yes_or_no.lower()[0:1] == 'y':
exit()
elif yes_or_no.lower()[0:1] == 'n':
main()
def clearScreen(os):
"""
Function to clear terminal/cmd screen compatible with Linux, Mac and Windows
"""
from subprocess import call
if os == 'unix':
command = 'clear'
else:
command = 'cls'
call(command, shell=True)
def main():
# Checking the system's OS
if platform not in ('win32', 'cygwin'):
os = 'unix'
else:
os = 'windows'
clearScreen(os)
title()
while True:
choose = int(input("SpaceX -> "))
switch(number=choose, system=os)
break
if __name__ == '__main__':
initialization()
main()