[gdal-dev] calling gdalinfo from python

Even Rouault even.rouault at mines-paris.org
Fri Oct 1 16:16:58 EDT 2010


Le vendredi 01 octobre 2010 22:07:26, keith a écrit :
> I'm just learning python and have imported gdalinfo.py, but I'm not sure
> how to call it.
> Is it gdalinfo.main('myimage.img')
> It's just giving me back the usage. The image file exists in the current
> working directory.
> 
> Thanks for any help! Using Python 2.6.

Try gdalinfo.main(['foo', 'myimage.img'])

The 'foo' is in fact gdalinfo.py when called from the command line, like 
python gdalinfo.py myimage.img


More information about the gdal-dev mailing list