-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
32 lines (23 loc) · 840 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
from app import task_1, task_2, task_4, task_3
import sys
def main():
save_file = False
save_path = ''
sec_arg = ["-medals", "-total", "-overall", "-interactive"]
medals =["Gold", "Silver", "Bronze"]
if sys.argv[1] not in sec_arg:
print("Error: The '-medals/overall/total/interactive' argument must be the second argument.")
sys.exit(1)
if len(sys.argv) == 6 and sys.argv[4] == '-output':
save_file = True
save_path = sys.argv[5]
if sys.argv[1] == sec_arg[0]:
task_1(save_file, save_path)
elif sys.argv[1] == sec_arg[1] and int(sys.argv[2]) >= 1896 and int(sys.argv[2]) <= 2016:
task_2(medals)
elif sys.argv[1] == sec_arg[2]:
task_3(medals)
elif sys.argv[1] == sec_arg[3]:
task_4(medals)
if __name__ == "__main__":
main()