On 20 sep, 08:31, "Dmitry Teslenko" <[EMAIL PROTECTED]> wrote:
> I'm using os.popen to perform lengthy operation such as building some > project from source. > def execute_and_save_output( command, out_file, err_file): > (i,o,e) = os.popen3( command ) You should consider using the higher-level "subprocess" module: import subprocess def run(command, output, error, bufsize=None): popen = subprocess.Popen(command.split(), bufsize=bufsize, stdout=output, stderr=error) popen.communicate() return popen.returncode example: create = lambda path: open(path, "w") run("ls /etc/services abc", create("/tmp/output"), create("/tmp/ error")) Check how to use the "bufsize" parameter in the docs: http://docs.python.org/lib/node529.html arnau -- http://mail.python.org/mailman/listinfo/python-list