I've searched fairly thoroughly for an answer, but haven't found any solutions to this.
I need to execute a child process only momentarily to print its version information. If run from the command line, it's simply
.\bin\application.exe --version
and version information is printed to the terminal. I'd like to capture that information in a string. I've been trying out variants of
args = ("path\to\application.exe", "--version")
subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0]
with no success. I also need this not to print the output to the terminal, if possible. What can I do?