[GRASS-user] python 'NamError' r.landscape.evol

Hello. In previous (win)grass versions I was able to work with r.landscape.evol addon. Now with 7.8.2 wingrass version appears a python NameError:

r.landscape.evol elev=DEM_21x21@PERMANENT initbdrk=0 smoothing=no prefx=levol_test outdem=elevation_test outsoil=soildepth_test number=1

Traceback (most recent call last):

File "C:\Users\USUARIO\AppData\Roaming\GRASS7\addons/scrip

ts/r.landscape.evol.py", line 665, in

f = file(statsout, ‘wt’)

NameError: name ‘file’ is not defined

It seems that the script was written in Python < 3 and ‘file()’ is not supported in Python 3. Is possible that the addon needs to transform into valid Python 3.x code?

Thanks for your help!

Maria Cecilia Zalazar wrote

Hello. In previous (win)grass versions I was able to work with
r.landscape.evol addon. Now with 7.8.2 wingrass version appears a python
NameError:

*r.landscape.evol elev=DEM_21x21@PERMANENT initbdrk=0 smoothing=no
prefx=levol_test outdem=elevation_test outsoil=soildepth_test number=1*

*Traceback (most recent call last):*

* File "C:\Users\USUARIO\AppData\Roaming\GRASS7\addons/scrip*

*ts/r.landscape.evol.py &lt;http://r.landscape.evol.py/&gt;&quot;, line 665, in
<module>
*

* f = file(statsout, 'wt')*

*NameError: name 'file' is not defined*

It seems that the script was written in Python < 3 and ‘file()’ is not
supported in Python 3. Is possible that the addon needs to transform into
valid Python 3.x code?

Thanks for your help!

some hints e.g. here:

https://stackoverflow.com/questions/28121163/python-3-doesnt-have-the-file-function/28121192

-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html

Maria Cecilia Zalazar wrote

Hello. In previous (win)grass versions I was able to work with
r.landscape.evol addon. Now with 7.8.2 wingrass version appears a python
NameError:

*r.landscape.evol elev=DEM_21x21@PERMANENT initbdrk=0 smoothing=no
prefx=levol_test outdem=elevation_test outsoil=soildepth_test number=1*

*Traceback (most recent call last):*

* File "C:\Users\USUARIO\AppData\Roaming\GRASS7\addons/scrip*

*ts/r.landscape.evol.py &lt;http://r.landscape.evol.py/&gt;&quot;, line 665, in
<module>
*

* f = file(statsout, 'wt')*

*NameError: name 'file' is not defined*

It seems that the script was written in Python < 3 and ‘file()’ is not
supported in Python 3. Is possible that the addon needs to transform into
valid Python 3.x code?

Thanks for your help!

_______________________________________________
grass-user mailing list

grass-user@.osgeo

https://lists.osgeo.org/mailman/listinfo/grass-user

I opened an issue here:

https://github.com/OSGeo/grass-addons/issues/156

Just comment or if you have a solution, open a PR there

-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html