It turned out to be a little painful. Maximus redirect nul did a great job, thanks!
As for working in python, it came down to the following. I started with:
BINARY = "C:/Program Files/foo/bar.exe" subprocess.call([BINARY])
Tried to add a redirect, but subprocess.call does it all too well and we lose the redirect.
subprocess.call([BINARY + " < nul"]) subprocess.call([BINARY, " < nul"]) subprocess.call([BINARY, "<", "nul"])
Using shell = True did not work, because the space in BINARY made him try to find the executable.
subprocess.call([BINARY + " < nul"], shell=True)
In the end, I had to go back to os.system and avoid myself in order to get a redirect.
os.system(quote(BINARY) + " < nul")
Not perfect, but he does his job.
If anyone knows how to get the latest example of a sub-process for working with space in binary format, it will be very appreciated!
source share