from subprocess import Popen import sys #filename = sys.argv[1] filename = "davisAPI.py" while True: print('Start'+filename) p = Popen("python " + filename, shell=True) p.wait()