[GRASS-dev] how to deal with a python keyword as a module option name?

Glynn Clements glynn at gclements.plus.com
Wed Feb 15 16:53:04 EST 2012


Hamish wrote:

> r.resamp.bspline uses 'lambda' as a command line parameter name, but when
> you try to use it with grass.run_command() you get an error as lambda is
> a python reserved keyword. How to work around that?

Prepend an underscore to the name, i.e.:

	grass.run_command('r.resamp.bspline', _lambda = ...)

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list