-
Notifications
You must be signed in to change notification settings - Fork 0
/
ai_exe
executable file
·37 lines (30 loc) · 896 Bytes
/
ai_exe
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
#!/usr/bin/env python3
##
## EPITECH PROJECT, 2023
## B-YEP-400-PAR-4-1-zappy-viktor.bruggeman
## File description:
## zappy_ai
##
# @file zappy_ai
from ai import main
import sys
import signal
## @author Damien
## @brief Ctrl-c handler so, when doing it, ther is no error messages
def signal_handler(sig, frame):
exit(0)
signal.signal(signal.SIGINT, signal_handler)
## @author Pierre-Louis
## @brief Removes useless executable name in argv
## @return arcv without executable name
def remove_executable_name() -> int:
return sys.argv[1:]
## @author Damien and Pierre-Louis
## @brief Calls the main of the main.py file
## @param argc is the length of argv
## @param argv contain argument given by the user
## @details Checks if the file is executed as a main program
while 1:
if __name__ == "__main__":
main.main(len(sys.argv) - 1, remove_executable_name())
pass