-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_training.py
57 lines (47 loc) · 1.18 KB
/
start_training.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Crocrodile Training.
Program for starting training algorithm.
:author: Virinas-code
"""
import sys
import os
print(os.getcwd())
def input_algorithm() -> int:
"""
Input training algorithm.
:return: Training algorithm indice.
:rtype: int
"""
print("Select an algorithm :")
print("\t1. Masters training")
print("\t2. Basics training")
while True:
algorithm = input("\tAlgorithm :")
try:
algorithm = int(algorithm)
except ValueError:
continue
if algorithm not in list(range(1, 3)):
continue
else:
return algorithm
def main(argv: list) -> int:
"""
Main function.
:param argv: sys.argv
:type argv: list
:return: Exit code.
:rtype: int
"""
algorithm = input_algorithm()
if algorithm == 1:
print(os.getcwd())
exec(compile(open("my_engine/masters_train.py").read(),
"my_engine/masters_train.py", "exec"))
elif algorithm == 2:
import my_engine.basics_train
my_engine.basics_train.main()
if __name__ == '__main__':
sys.exit(main(sys.argv))