forked from kjzieba/PC-Ambilight
-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
33 lines (23 loc) · 779 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
import sys
import gui
import send_data
if __name__ == '__main__':
if len(sys.argv) == 3 or len(sys.argv) == 4:
try:
number_of_diodes_in_column = int(sys.argv[1])
number_of_diodes_in_row = int(sys.argv[2])
if len(sys.argv) == 4:
if sys.argv[3] == 'gui':
gui.gui(number_of_diodes_in_column, number_of_diodes_in_row)
exit(0)
else:
print("Wrong arguments!")
exit(2)
send_data.start(number_of_diodes_in_column, number_of_diodes_in_row)
except ValueError:
print("Wrong arguments!")
exit(1)
else:
print("Wrong number of arguments")
exit(1)
exit(0)