-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.py
More file actions
40 lines (36 loc) · 1.11 KB
/
Copy pathtest.py
File metadata and controls
40 lines (36 loc) · 1.11 KB
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
from multiprocessing import Process
import sys
sys.path.append("sells/script/")
from sells_TPE import SELLS_TPE_INIT
from sells_NTC import SELLS_NTC_INIT
from info_box_TPE import INFO_BOX_TPE_INIT
from info_box_NTC import INFO_BOX_NTC_INIT
from house_box_TPE import HOUSE_BOX_TPE_INIT
from house_box_NTC import HOUSE_BOX_NTC_INIT
from img_TPE import IMG_TPE_INIT
from img_NTC import IMG_NTC_INIT
if __name__ == '__main__':
pl = [INFO_BOX_TPE_INIT, INFO_BOX_NTC_INIT, HOUSE_BOX_TPE_INIT, HOUSE_BOX_NTC_INIT, IMG_TPE_INIT, IMG_NTC_INIT]
p = [None] * 6
p1 = Process(target = SELLS_TPE_INIT)
p2 = Process(target = SELLS_NTC_INIT)
# start colleting data
p1.start()
p2.start()
# p1, p2 須執行完才能往下進行
p1.join()
p2.join()
p1.close()
p2.close()
print("Data collection succeed")
try:
for i in range(0, 6):
p[i] = Process(target = pl[i])
p[i].start()
for i in range(0, 6):
p[i].join()
p[i].close()
except Exception as e:
print(e)
finally:
print("sells data collection complete")