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?

Yes it does. The return value of the call is the exit code of the subprocess.

The manual doesn’t explicitly say, but it does imply that it waits for the end of the process by saying that the return value is the return value of the program.

So to answer your question, yes it does wait.

On Mac it waits, but on Linux it does not (Debian, python 3.7.3).

Fixed using subprocess:

import subprocess

subprocess.run("cmd")