<div dir="ltr"><div dir="ltr"><div>dear all,<br></div>i found where the error was! i didn't set the "g.list" command properly, in fact the map calculator could not find maps . However , here it is how i ran the mapcalc:<br>> gscript.mapcalc ( " %s = %s * %s "  % ((r+"k") , r , c))<br></div><div>to Frank : k is just a suffix i wanted to use in order to give to the new map a name similar to the older map (r in this case) <br></div></div><br><div class="gmail_quote"><div dir="ltr">Il giorno mer 12 dic 2018 alle ore 13:01 Frank David <<a href="mailto:frank.david@geophom.fr">frank.david@geophom.fr</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
What do you want to do with "k" ?<br>
<br>
Can you send what return gscript.verbose(( " %s = %s * %s ")  % (r , r , c))<br>
<br>
Frank<br>
Le 12/12/2018 à 17:34, Alessandro Sebastiani a écrit :<br>
> I get the same error after trying with your suggestion! I tried to <br>
> define rasters in different ways, like<br>
> >> c = ["costante"] ,<br>
> but nothing seems to change<br>
><br>
> Il giorno mer 12 dic 2018 alle ore 10:22 Moritz Lennert <br>
> <<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a> <mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>>> <br>
> ha scritto:<br>
><br>
>     On 12/12/18 12:59, Alessandro Sebastiani wrote:<br>
>     > dear all,<br>
>     > i'm dealing this time with r.mapcalc. I have different rasters<br>
>     which i<br>
>     > grouped using g.list.<br>
>     > Now r_list contains all my raster. I want to multiply those<br>
>     rasters to<br>
>     > another raster (called "costante")  in order to obtain a new<br>
>     map, that i<br>
>     > want to call as r followed by the letter "k"<br>
>     > Here it is what i've done:<br>
>     > import grass.script as gscript<br>
>     >  >>> r_list = gscript.read_command("g.list" , type = "rast"<br>
>     > ).strip().split("\n")<br>
>     >  >>> c = " costante"<br>
>     >  >>> for r in r_list:<br>
>     >  >>>     gscript.mapcalc ( " %s = %s * %s "  % ((r+"k") , r , c))<br>
><br>
>     Try<br>
><br>
>     " %sk = %s * %s "  % (r , r , c) "<br>
><br>
>     Moritz<br>
><br>
><br>
> _______________________________________________<br>
> grass-user mailing list<br>
> <a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a></blockquote></div>