0

I have some code in a python script that runs an executable like this

import subprocess

subprocess.Popen(["C:\executable.exe", "arg1", "arg2"], shell=False)

I've also tried

subprocess.call("C:\executable.exe", "arg1, "arg2"])

With the same results.

The program runs but this program also closes the program that called it, this is true whether I run it from the command line or python. The problem is I need to wait for the execution of the program to finish and then continue with the rest of the script. Is there a way to prevent the application from closing my python console?

richbai90
  • 4,994
  • 4
  • 50
  • 85
  • "this program also closes the program that called it" - what program are you dealing with? This information may be important for answering your question. – user2357112 Jun 03 '16 at 18:06
  • It's one of my company's internal programs our devs built. It's a 32bit application with a gui. Beyond that I don't know much about it. what I do know is that according to documentation windows consoles will automatically close when the process attached to it terminates, which I think is what is happening here. – richbai90 Jun 03 '16 at 18:08

0 Answers0