My code is as follows... count = 0 while count < 3: count += 1 subprocess.Popen('command') if count == 3: sys.exit()
'command' is any command. For testing, I have been using the command 'xterm' just so I can see it opening. As far as error and pertaining to the above code, if I close the xterm window, have it open back up until the counter reaches the specified number. I am basically trying to recreate in python a shell script I use. The current shell script runs a real long avconv/ bmdplay command and if the command stops running, the script will try and rerun it until count equals n number. Again, I am only using xterm temporarily while I try to get the logic correct. Once correct, I can change the command and still have the same outcome...I think. I am not using a function. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor