File size: 559 Bytes
29cdc9d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import subprocess
import os
class ServiceManager:
def __init__(self, root="src/devcore/sandbox/project_build"):
self.root = root
self.process = None
def start(self):
# Pointing to the new entry point: main.py
self.process = subprocess.Popen(
["python3", "main.py"],
cwd=self.root,
env={**os.environ, "PYTHONPATH": self.root}
)
print(f"[+] SERVICE STARTED: PID {self.process.pid}")
def stop(self):
if self.process:
self.process.terminate()
|