Usage: $~/looper runSomePythonScript.py
#!/usr/bin/python
import subprocess
import time, sys
PYTHON = '/usr/bin/python'
def main():
commands = [PYTHON]
commands.extend(sys.argv[1:])
print "Looping %s" % commands
while True:
subprocess.call(commands)
print "4 seconds to restart"
time.sleep(2)
if __name__ == "__main__":
main()