import sys
import subprocess
import os
os.chdir("C:\\code\\runcommand\\")
command = "my.exe"
subprocess.Popen(command)
with above code my.exe runs on command prompt and gets closed. How to prevent command prompt from closing.
import sys
import subprocess
import os
os.chdir("C:\\code\\runcommand\\")
command = "my.exe"
subprocess.Popen(command)
with above code my.exe runs on command prompt and gets closed. How to prevent command prompt from closing.
If you simply want leave open the command prompt you can add input() as last line (read more...). Then cmd will be close after hitting any key.