[GRASS-dev] Help - run r.profile through python

Glynn Clements glynn at gclements.plus.com
Fri Nov 5 20:33:03 EDT 2010


melolp wrote:

> grass.run_command("r.profile",-g,input= teste1,output = teste, [12244.256 -295112.597,12128.012 -295293.77])

> However I'm having the following error mesage:
> 
> "non-keyword arg after keyword arg grass.run_command"

All arguments except the first are keyword arguments, i.e. "arg = val".

	grass.run_command(
		"r.profile",
Okay
		-g,

This should be: flags = 'g'. "-g" would be the negative of a Python
variable namd "g".

		input= teste1,
		output = teste,
Okay
		[12244.256 -295112.597,12128.012 -295293.77])

This should be:
		profile = [12244.256,-295112.597,12128.012,-295293.77]
or:
		profile = [(12244.256,-295112.597),(12128.012,-295293.77)]

i.e. you need to provide the keyword, and the argument must be a valid
Python expression. run_command() etc accept lists and tuples.

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


More information about the grass-dev mailing list