Kkaa wrote: > I'm using the os.system command in a python script on Windows to run a > batch file like this: > > os.system('x.exe') > > The third-party program x.exe outputs some text to the console that I > want to prevent from being displayed. Is there a way to prevent the > output of x.exe from python?
using the subprocess module to create a subprocess and piping the stdout,stdin and stderr so you wont see any ouput from the process unless you read from the PIPE's. import subprocess p = subprocess.Popen("x.exe", shell=True, stdout=subprocess.PIPE,stdin=subprocess.PIPE, stderr=subprocess.PIPE) Cheers - http://bulkan.googlepages.com/python/ -- http://mail.python.org/mailman/listinfo/python-list