The Python manual says nothing about whether os.system("cmd")
waits or not for a process to end:
To quote the manual:
Execute the command (a string) in a subshell.
It looks like it does wait (same behaviour as Perl's system
). Is this correct?
Answer #1: os. system() does wait for its process to complete before returning. If you are seeing it not wait, the process you are launching is likely detaching itself to run in the background in which case the subprocess.
wait() method in Python is used by a process to wait for completion of a child process. This method returns a tuple containing its PID and exit status indication.
The os. system() function executes a command, prints any output of the command to the console, and returns the exit code of the command.
Yes it does. The return value of the call is the exit code of the subprocess.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With