another grass python library question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

another grass python library question

Michael Barton
Here is another issue with an infurating problem of parameter pairs.

I have input map names saved to a set of variables. 
I want to do the following:

grass.run_command('g.copy ', raster=[variable],[mapname])

The output [mapname] can be a string for a mapname or a previously defined variable containing the mapname. 

I've looked at the docs for the scripting and python libraries and nothing there helps. I consistently get a file not found error or  a syntax error if I try to use string substitution. 


Michael

____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity 
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
















_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
SBL
Reply | Threaded
Open this post in threaded view
|

Re: another grass python library question

SBL

What about:

grass.run_command('g.copy ', raster='{},{}'.format(variable, 'mapname')

 

 

 

 

 

 

 

 

 

 


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

Re: another grass python library question

Michael Barton
Could try. I found another way, after trying several that didn't work.

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity 
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)















On Mar 7, 2019, at 2:22 PM, Stefan Blumentrath <[hidden email]> wrote:

What about:
grass.run_command('g.copy ', raster='{},{}'.format(variable, 'mapname')


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev