Luis Lisboa wrote:

> I have a script where I need to define a region based on 2 rasters output[0]
> and output[1].
> 
> I'm using thwe following expression:
> grass.run_command("g.region", rast = output[2] output[3], res= t_srx)
> 
> But This is not correct. my question is how can I have both rasters without
> getting an error?
> (I have tried also with
> grass.run_command("g.region", rast = output[2],output[3], res= t_srx) and it
> didn't workl

You can pass lists or tuples for options which accept multiple values,
e.g.:

        grass.run_command("g.region", rast = (output[2], output[3]), res= t_srx)
or:
        grass.run_command("g.region", rast = [output[2], output[3]], res= t_srx)
or:
        grass.run_command("g.region", rast = output[2:4], res= t_srx)

[The last one requires that "output" is a list or tuple and not e.g. 
an array.]

For a tuple, you need the parentheses to prevent the comma from being
treated as an argument separator.

-- 
Glynn Clements <gl...@gclements.plus.com>
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to