0

Hi,
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..

2
Contributors
2
Replies
4
Views
8 Years
Discussion Span
Last Post by vjp08
0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.