Gerhard said:
Something like this:
import os
while 1:
os.system("j:/UT2003/System/UT2003.exe")
os.system executes a program and waits, until the program is terminated.
But there's no way to know wether the program was terminated
deliberately or wether it crashed.
There is a way. Quoting the documentation for the os module for os.system:
The return value is the exit status of the process encoded in the format
specified for wait(), except on Windows 95 and 98, where it is always 0.
And for os.wait:
exit status indication: a 16-bit number, whose low byte is the signal number
that killed the process, and whose high byte is the exit status (if the signal
number is zero); the high bit of the low byte is set if a core file was produced.
According to my experience, it is also better to test for None in the return
value, since it seems to happen when everything is OK. So, doing:
while 1:
exitStatus = os.system("command...")
if exitStatus is None: break
if exitStatus & 0xFF == 0: break
should do the trick.
HTH