<div dir="ltr">Hai Maxi,<div><br></div><div>Sorry, I missed { when I write the mail, but while running I have used it correctly, still same error!</div><div><br></div><div>regards,</div><div>Vinay</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 1, 2016 at 1:51 PM, Massimiliano Cannata <span dir="ltr"><<a href="mailto:massimiliano.cannata@supsi.ch" target="_blank">massimiliano.cannata@supsi.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Looks like you missed one { before of Red. Don't know...maybe isn't it bur give a try.</p>
<p dir="ltr">Maxi</p>
<div class="gmail_quote"><div><div>Il 01/Lug/2016 06:15, "Vinay Elothunkal" <<a href="mailto:vinay223333@gmail.com" target="_blank">vinay223333@gmail.com</a>> ha scritto:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><span style="font-size:12.8px">Hi all,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Can anyone please help me to solve the error with '@' mark which comes along with mapset in python GRASS script. I get the following error when I run "mapcal.py"</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><i>syntax error, unexpected '@', expecting '('</i><br></div><div style="font-size:12.8px"><i><br></i></div><div style="font-size:12.8px"><div style="font-size:12.8px"><span style="color:rgb(133,140,147);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;font-size:13px;background-color:rgb(239,240,241)"># mapcal.py</span></div></div><div style="font-size:12.8px"><span style="color:rgb(133,140,147);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;font-size:12.8px">import grass.script as g</span><br></div><div style="font-size:12.8px"><div style="font-size:12.8px"><font color="#858c93" face="Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif">lis=['a@mapset','b@mapset']</font></div><div style="font-size:12.8px"><font color="#858c93" face="Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif">for i in lis:</font></div><div style="font-size:12.8px"><font color="#858c93" face="Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif"><br></font></div><div style="font-size:12.8px"><font color="#858c93" face="Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif"> g.mapcalc("{tmp_NDVI}=float({NIR}-Red})/float({NIR}+{Red})"</font><font color="#858c93" face="Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif">.format(tmp_NDVI='NDVI'+str(i), NIR='B5</font><span style="color:rgb(133,140,147);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;font-size:12.8px">@mapset</span><font color="#858c93" face="Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif" style="font-size:12.8px">',Red='B4</font><span style="color:rgb(133,140,147);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;font-size:12.8px">@mapset</span><font color="#858c93" face="Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif" style="font-size:12.8px">'),overwrite=True)</font><span style="font-size:13px;color:rgb(133,140,147);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241)"> </span></div></div><div style="font-size:12.8px"><span style="font-size:13px;color:rgb(133,140,147);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241)"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px"> </span><br></div><div style="font-size:12.8px">Thanks,</div></div>
<br></div></div>_______________________________________________<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="http://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br></blockquote></div>
</blockquote></div><br></div></div>