0

How to start multiple Python scripts from one Python script ? I need on restart to start couple scripts ( server.py => Tornado, backup.py => scheduler to dump database, watcher => monitoring system). All those I was starting manually one by one, how to start all of them in separated processes through one new script ( like python all.py)

1
  • Have a look at subprocess which can help you in starting any file you want. But if you want them to be in a single python process: Import the scripts and execute them in a new thread. I hope you have if __name__ == '__main__': statements in your scripts. Commented Aug 20, 2013 at 12:27

1 Answer 1

1
p = subprocess.Popen(command, shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)

For more informations read this

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.