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?
Answers:
- you have to first click one your cmd…it opens next
- you have to click second time your cmd then it open second window
….
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.
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?
- you have to first click one your cmd…it opens next
- you have to click second time your cmd then it open second window
….
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.