[GRASS-dev] Popen and r.mapcalc, pygrass' implications
glynn at gclements.plus.com
Thu Aug 14 04:08:49 PDT 2014
> Pygrass is not working properly with r.mapcalc, the problem is how the
> Popen class is used internally, so playing with Popen class:
> In : import subprocess as sub
> In : cmd_list = ['r.mapcalc', 'expression="elev100=elevation*100"', '--o']
This is wrong. The double-quote characters shouldn't be there.
> In : sub.Popen(cmd_shell, shell=True)
Passing a string instead of a list is rarely a good idea. Apart from
anything else, you have to construct the string differently depending
upon whether you're using Unix or Windows (/bin/sh and cmd.exe have
significant differences in their command syntax).
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev