Wednesday, 18 May 2011

Automate python script to run itself when some exception

Hi,
 Recently was goin through a python script where the script was closing with an exception when a client socketserver closes.I wanted my socketserver to be up and running continuously after a client closes also.So found out that can use "process"  module to do this say you are running "some.py " and u want the same script to start running after exception just two lines of code:

import process
child = subprocess.Popen("python some.py")


Happy coding

No comments:

Post a Comment