-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo.py
50 lines (36 loc) · 968 Bytes
/
demo.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
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import threading
from Detect import face
import glo
from VirtualScene import alive_scene
arr_position = [0, 0, 0, 0]
class DetectMove(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
# print(arr_position)
print('starting detect move.')
while True:
arr_position[0] += 1
class AliveScene(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
print('starting alive scene.')
while True:
print(arr_position)
def main():
glo.init()
thread1 = face.Position()
thread2 = alive_scene.AliveScene()
thread1.start()
thread2.start()
threads = [thread1, thread2]
# 添加线程到线程列表
# 等待所有线程完成
for t in threads:
t.join()
print("Exiting Main Thread")
if __name__ == '__main__':
main()