-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
51 lines (41 loc) · 1011 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
44
45
46
47
48
49
50
51
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# main.py
#
# Solar-boat Project 2019
# created on: 2019/07/25
# Author: Tetsuro Ninomiya
#
import sys
import time
def main():
# confirm python3
version_info = sys.version_info
if version_info.major < 3:
print("Use python3.")
print("Usage: python3 main.py [parameter_file]")
return
# Command line arguments
args = sys.argv
if len(args) < 2:
print("[ERROR] NO ARGUMENTS")
print("Usage: python3 main.py [parameter_file]")
return
# Initialize
from Driver import Driver
driver = Driver(args[1])
try:
# Confirming initial mode
driver.check_mode_change()
# Control Loop
driver.do_operation()
except KeyboardInterrupt:
print("KeyboardInterrupt")
finally:
# If you end this program,
# this program set the system to stop
driver.end()
print("finish")
if __name__ == "__main__":
main()