system exec ?

Arun Ramanathan aramanat at optonline.net
Thu Jul 5 21:06:23 EDT 2001


alphaZeta wrote:

> Hi,
>
> I didn't find any documentation (lib and tut) about how to execute a program
> in a python script.
> Does anybody know ?

import os
result =  os.popen('program').read()
or
import commands
result = commands.getoutput('program')

Arun







More information about the Python-list mailing list