import subprocess filepath="start.bat" import time while True: p = subprocess.Popen(filepath, shell=True, stdout = subprocess.PIPE) stdout, stderr = p.communicate() print(p.returncode) # is 0 if success time.sleep(10)