Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def run_command(command):
- filename = 'test.log'
- with io.open(filename, 'wb') as writer, io.open(filename, 'rb', 1) as reader:
- process = subprocess.Popen(command, stdout=writer)
- while process.poll() is None:
- time.sleep(0.5)
- class MyThread(Thread):
- STOP = False
- def __init__(self, name):
- Thread.__init__(self)
- self.name = name
- def run(self):
- global OUTPUT, STOP
- print(235)
- #p = subprocess.Popen("python main.py", stdout=subprocess.PIPE, bufsize=2)
- #for line in iter(p.stdout.readline, b''):
- if(self.name == "run"):
- run_command("./venv/Scripts/python main.py")
- if(self.name == "stop"):
- """Nothing..."""
- /venv/Scripts/python interface.py
Add Comment
Please, Sign In to add comment