[GRASS-user] g.remove multiple files in python
Pietro
peter.zamb at gmail.com
Fri Jan 25 06:57:10 PST 2013
Hi Margherita,
On Fri, Jan 25, 2013 at 3:28 PM, Margherita Di Leo <diregola at gmail.com> wrote:
> Hi,
>
> how to convert something like:
>
> g.remove rast=`g.mlist pat=r_start* sep=,`
>
> in python?
GRASS7: r54769
>>> from pygrass.modules import general as g
>>> from pygrass.gis import Mapset
>>> g.remove(vect=Mapset().glist('vect', pattern='points*'))
Removing vector <points04>
Removing vector <points01>
Removing vector <points02>
Removing vector <points00>
Removing vector <points03>
The method glist, of the Mapset class return a list of maps:
>>> Mapset().glist('vect', pattern='points*')
['points04', 'points01', 'points02', 'points00', 'points03']
More information about the grass-user
mailing list