[SciPy-user] execute program from withn python

bryan cole scipy-user@scipy.net
03 Feb 2003 16:42:20 +0000


Try "os.spawnl()" or one of it's relatives (there are eight different
variations ... see the Python reference docs). Alternatively, you could
use "os.popen()" (4 versions!) to run gunzip on a file and read the
result directly into python via a pipe (no need to write an intermediate
file).

Bryan

On Mon, 2003-02-03 at 16:27, Agustin Lobo wrote:
> Is there any way to run a program
> from within python?
> 
> I would like to run gunzip
> (and other programs) and
> then read in the result.
> This is done within a loop, 
> and beacuse of reasons
> of disk space, it is not convenient
> for me in theis case to run the program first for
> all files and then start python.
> 
> Thanks
> 
> Agus
> 
> Dr. Agustin Lobo
> Instituto de Ciencias de la Tierra (CSIC)
> Lluis Sole Sabaris s/n
> 08028 Barcelona SPAIN
> tel 34 93409 5410
> fax 34 93411 0012
> alobo@ija.csic.es
> 
> 
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
-- 
Bryan Cole
Teraview Ltd., 302-304 Cambridge Science Park, Milton Road, Cambridge CB4 0WG, United Kingdom.
tel: +44 (1223) 435380 / 435386 (direct-dial) fax: +44 (1223) 435382