i want to run a python script from another python sript as a new process. i have tried with spawn functions of os module but it didnt work. i guess these functions work on only Linux. how to create a new process on windows platform..

Recommended Answers

All 2 Replies

You can use the subprocess module

import subprocess
child = subprocess.Popen("myprog.py")

see the documentation of this module. There are other ways to call your program;

child = subprocess.Popen("python myprog.py", shell=True)

for example.


it worked...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.