daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest Jul 23rd, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def run_command(command):
  2.     filename = 'test.log'
  3.     with io.open(filename, 'wb') as writer, io.open(filename, 'rb', 1) as reader:
  4.         process = subprocess.Popen(command, stdout=writer)
  5.         while process.poll() is None:
  6.             time.sleep(0.5)
  7.    
  8. class MyThread(Thread):
  9.     STOP = False
  10.     def __init__(self, name):
  11.         Thread.__init__(self)
  12.         self.name = name
  13.  
  14.     def run(self):
  15.         global OUTPUT, STOP
  16.         print(235)
  17.         #p = subprocess.Popen("python main.py", stdout=subprocess.PIPE, bufsize=2)
  18.         #for line in iter(p.stdout.readline, b''):
  19.         if(self.name == "run"):
  20.             run_command("./venv/Scripts/python main.py")
  21.         if(self.name == "stop"):
  22.             """Nothing..."""
  23.    
  24. /venv/Scripts/python interface.py
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top