Python Forum

Full Version: Spawning a new process that is not attached to python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to write a code that executes a certain number of files in a directory. However, I do not want these files to be attached to python (aka python is the parent application) and I want them to have a completely different process group. Here is the code I am currently stuck on.

for x in os.listdir():
subprocess.Popen(x, creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
to start with, line 2 is not indented.
It is in the actual program... not sure why it is not here.
When I launch the external program, I do not want it to launch as a child process if that makes sense.