Open .exe on external terminal in Python

Issue

I would like to run a .exe file on external terminal.
With this code I managed to run the .exe but it starts on the same terminal I call the script

import subprocess
subprocess.call(["C:/Users/Alessandro/Downloads/BOSCH-GLM/BOSCH-GLM/dist/glm50.exe"])

Is there a way to run it on external terminal?

Solution

Try using subprocess.Popen instead of subprocess.call.

Take a look at the discussion here. You can ignore the .communicate() call.

Answered By – M Z

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published