obtain the output of an external program

klappnase klappnase at web.de
Mon Nov 17 14:50:54 CET 2003


Fernando Rodriguez <frr at easyjob.net> wrote in message news:<n0ehrvgtppdbs9cl82e24lmc7vk2k5cd3e at 4ax.com>...
> Hi,
> 
> How can I save the output of an external program, called with os.system()?

Use commands.getoutput() instead of os.system():

import commands
xy = commands.getoutput(external_program)

Regards

Michael




More information about the Python-list mailing list