-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
43 lines (36 loc) · 976 Bytes
/
run.py
File metadata and controls
43 lines (36 loc) · 976 Bytes
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
import multiprocessing
import subprocess
# To run Jarvis
def startAlpha():
try:
import eel
print("eel imported successfully in process 1")
except ImportError:
print("Error importing eel in process 1")
# Code for process 1
print("Process 1 is running.")
from main import start
start()
# To run hotword
def listenHotword():
try:
import eel
print("eel imported successfully in process 2")
except ImportError:
print("Error importing eel in process 2")
# 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=startAlpha)
p2 = multiprocessing.Process(target=listenHotword)
p1.start()
subprocess.call([r'devices.bat'])
p2.start()
p1.join()
if p2.is_alive():
p2.terminate()
p2.join()
print("system stop")