I don\'t understand why it\'s so hard to do this on Windows.
I want to spawn a bunch of command prompt windows which will run other scripts. The reason I want this i
Upon reading your comment to my previous answer what you need is:
os.system("start /wait cmd /c {command}")
Keep the windows command reference always at hand!
For me this seems to work
os.system("cmd /k {command}")
With /k
cmd executes and then remain open
With /c
executes and close
To open a new command window and then execute the command
os.system("start cmd /k {command}")
The accepted answer didn't work for me.
To open on a new command prompt I had to use:
os.system("start /B start cmd.exe @cmd /k mycommand...")
You can pass /WAIT to the start
command to make it wait for termination.
How about
os.system("cmd /c {command here}")
Or even
os.system("{command here}")
It is the start command the one that is launching a separate session instead of using the same one the python program is running on.