Run a linux program through python

Martin Franklin mfranklin1 at gatwick.westerngeco.slb.com
Fri Jun 20 03:59:52 EDT 2003


Gunnar Staff wrote:

>I would like ti run a linux program through a 
>python script. Do enyone know the syntax for 
>running a OS program from python?
>
>Assume I'll run
>$ convert fromfile tofile
>
>Gunnar
>  
>

There are several ways depending on the level of 'control' however given 
your
 simple example I would say

import os

os.system("convert fromfile tofile")

Would be your best bet

HTH
Martin






More information about the Python-list mailing list