Python Forum
Spawning a new process that is not attached to python - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Spawning a new process that is not attached to python (/thread-26259.html)



Spawning a new process that is not attached to python - cman234 - Apr-25-2020

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)



RE: Spawning a new process that is not attached to python - Larz60+ - Apr-25-2020

to start with, line 2 is not indented.


RE: Spawning a new process that is not attached to python - cman234 - Apr-25-2020

It is in the actual program... not sure why it is not here.


RE: Spawning a new process that is not attached to python - cman234 - Apr-25-2020

When I launch the external program, I do not want it to launch as a child process if that makes sense.