I am reading a folder of multiple images and here's the part of code where i read the folder specified in path,
path = 'C:\main\folder\sub-folder\08001\V.1\abc\2015'
for infile in glob.glob( os.path.join(path, '*.tif') ):
Img = gdal.Open( infile )
if Img is None:
print 'Unable to open Input Image'
sys.exit(1)
... so the code doesn't work as in it doesn't read any files in that folder but it also doesn't throw any error. I figured that it's not working only when the path has any of the Sub-folder's name starting with numeric values.
Here Path = 'C:\main\folder\sub-folder\08001\V.1\abc\2015' and as you can see it has two Sub-folder's (08001 and 2015) starting with numeric values.
** It works absolutely fine when there are no such sub-folder's starting with numeric values.
Why does this happen and how can i fix this ?? Also how can i automatically look into any sub-folder's if exist in the original path provided ?
when i look for that path in command shell, here's what it shows.
>>> path = 'C:\P\S\Mo\C\08008\L\V.1R\2015'
>>> path
'C:\\P\\S\\Mo\\C\x008008\\L\\V.1R\x815'