forked from projectswithdigambar/jarvis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
34 lines (26 loc) · 738 Bytes
/
run.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
import multiprocessing
import subprocess
# To run Jarvis
def startJarvis():
# Code for process 1
print("Process 1 is running.")
from main import start
start()
# To run hotword
def listenHotword():
# Code for process 2
print("Process 2 is running.")
from engine.features import hotword
hotword()
# Start both processes
if __name__ == '__main__':
p1 = multiprocessing.Process(target=startJarvis)
p2 = multiprocessing.Process(target=listenHotword)
p1.start()
subprocess.call([r'device.bat'])
p2.start()
p1.join()
if p2.is_alive():
p2.terminate()
p2.join()
print("system stop")