setup.py 336 B

12345678910111213141516
  1. import subprocess
  2. import sys
  3. import os
  4. def start(args):
  5. os.system("make && ./hello &")
  6. return 0
  7. def stop():
  8. p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
  9. out, err = p.communicate()
  10. for line in out.splitlines():
  11. if 'hello' in line:
  12. pid = int(line.split(None, 2)[1])
  13. os.kill(pid, 9)
  14. return 0