[GRASS-user] Find rasters by using a wildcard

Greetings

Currently, I’m using this expression to find a raster file (in a Python script):
grass.find_file(raster_map, element = ‘cell’, mapset=mapset)

My problem is that now I need to find files that are not called raster_maps but that incldues a specific string E.g. raster. So I would like to list all files with that string on its name in a defined MAPSET
How can I do that in a GRASS python script?
Thanks
Pedro

Depending on what you want to do in detail, grass.run_command(“g.mlist”, …) may help …

Christian.

From: Pedro Roma
Sent: Thursday, February 17, 2011 10:30 AM
To: GRASS user list
Subject: [GRASS-user] Find rasters by using a wildcard

Greetings

Currently, I’m using this expression to find a raster file (in a Python script):
grass.find_file(raster_map, element = ‘cell’, mapset=mapset)

My problem is that now I need to find files that are not called raster_maps but that incldues a specific string E.g. raster. So I would like to list all files with that string on its name in a defined MAPSET
How can I do that in a GRASS python script?
Thanks
Pedro



grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user