startTask.py0512 240 B

12345678
  1. import subprocess
  2. filepath="start.bat"
  3. import time
  4. while True:
  5. p = subprocess.Popen(filepath, shell=True, stdout = subprocess.PIPE)
  6. stdout, stderr = p.communicate()
  7. print(p.returncode) # is 0 if success
  8. time.sleep(10)