You can try subprocess.check_output with -json option.
It will save a structure with your desidered information.
https://docs.python.org/2/library/subprocess.html
2017-03-29 16:18 GMT+02:00 Even Rouault-2 [via OSGeo.org] <
ml-node+s1560n5314820...@n6.nabble.com>:
> On mercredi 29 mars 2017 06:51
On mercredi 29 mars 2017 06:51:11 CEST Johan de Braak wrote:
> Hi all,
>
> Using gdal.Info in Python, I would like to have my result as a dictionary
> instead of a string. I found that in gdal.InfoOptions I am able to specify
> 'format'. By default, this is set to 'text', however changing this to
Hi all,
Using gdal.Info in Python, I would like to have my result as a dictionary
instead of a string. I found that in gdal.InfoOptions I am able to specify
'format'. By default, this is set to 'text', however changing this to 'dict'
(or anything really) does still result in a string.
Is there a