How to get output of exe in python script?
问题 When I call an external .exe program in Python, how can I get printf output from the .exe application and print it to my Python IDE? 回答1: To call an external program from Python, use the subprocess module. The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. An example from the doc ( output is a file object that provides output from the child process.): output = subprocess.Popen(["mycmd", "myarg"], stdout=subprocess