[GRASS-user] Retrieving Subsets names from gdalinfo with Python

Glynn Clements glynn at gclements.plus.com
Thu Feb 25 16:10:49 EST 2010


Nikos Dumakis wrote:

> 2- If not, how can I store in a variable the result from GDALinfo?

import grass.script as grass
result = grass.Popen(['gdalinfo',...], stdout = grass.PIPE).communicate()[0]

Note: grass.Popen() is a thin wrapper around subprocess.Popen(). The
only difference is that grass.Popen() automatically sets shell=True on
Windows (so that scripts work as well as binary executables).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list