[GRASS-user] some issues with python scripts

Carlos Grohmann carlos.grohmann at gmail.com
Mon Jan 17 11:29:40 EST 2011


Hello Martin. Thanks for your answers

>
> this corresponds with behaviour of g.findfile
>
Well, yes. I just thought that once the wx interface will always
provide the full name when a map is selected,
then the name should be parsed so that 'name' and 'full_name' don't be the same.


>
>> 3 - temp files.

> Sample code?
here. r.mapcalc can't deal with the slashes in the path.

>>>> import grass.script as grass
>>> a = grass.tempfile()
>>> a
'/home/guano/grassdata/amsul_wgs84/brasil/.tmp/guanodesk/16665.0'
>>> grass.mapcalc("${out} = cos(${rast1})", out = 'cosine', rast1 = a)
syntax error, unexpected '/'
Parse error
ERROR: parse error
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/grass-7.0.svn/etc/python/grass/script/raster.py",
line 105, in mapcalc
    fatal(_("An error occurred while running r.mapcalc"))
TypeError: 'str' object is not callable
>>>


best,
Carlos

-- 
Prof. Carlos Henrique Grohmann - Geologist D.Sc.
Institute of Geosciences - Univ. of São Paulo, Brazil
http://www.igc.usp.br/pessoais/guano
http://lattes.cnpq.br/5846052449613692
Linux User #89721
________________
Can’t stop the signal.


More information about the grass-user mailing list