Skip to content

Tag: subprocess

Run Process and Don’t Wait

I’d like to run a process and not wait for it to return. I’ve tried spawn with P_NOWAIT and subprocess like this: However, the console window remains until I close Notepad. Is it possible to launch the process and not wait for it to complete? Answer This call doesn’t wait for the child proce…

Actual meaning of ‘shell=True’ in subprocess

I am calling different processes with the subprocess module. However, I have a question. In the following code: and Both work. After reading the docs, I came to know that shell=True means executing the code through the shell. So that means in absence, the process is directly started. So what should I prefer f…

read subprocess stdout line by line

My python script uses subprocess to call a linux utility that is very noisy. I want to store all of the output to a log file and show some of it to the user. I thought the following would work, but the output doesn’t show up in my application until the utility has produced a significant amount of output…