try this:
from osgeo import gdal
gdal.UseExceptions()
gdal.Open('noexist.tif')
This is from: http://trac.osgeo.org/gdal/wiki/PythonGotchas
On Sun, Aug 5, 2012 at 5:41 PM, Mike Toews wrote:
> I would like to capture or show GDAL error messages in an interactive
> Python shell. For instance, if
I would like to capture or show GDAL error messages in an interactive
Python shell. For instance, if trying to open an non-existing raster:
from osgeo import gdal
ds = gdal.Open('noexist.tif')
shows nothing in an interactive shell (PythonWin, IDLE), but shows
messages when used in a shell (cmd.ex