Run CMD command in python script in ANOTHER Shell

Question:

I am running a pogram "xxx" in the windows cmd shell.
With a python script I want to check whether this specific process "xxx" is frozen or not.
If so, it should reopen the process with

os.system(r'xxx.bat')

but then the python script does no check anymore because its running the process…

How can I open another, standalone CMD Terminal so that the python script starts checking again immediately after opening the shell?

Asked By: Mabignix

||

Answers:

  1. you have to first click one your cmd…it opens next
  2. you have to click second time your cmd then it open second window
    ….
Answered By: Praful Pawar

For a non-blocking solution, you should try: os.startfile(xxx.bat)

However, note that os.startfile() will run the file with the application associated to the extension of said file.

Answered By: Mabignix