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

Markus Neteler neteler at osgeo.org
Fri Nov 5 17:52:39 EDT 2010


On Fri, Nov 5, 2010 at 1:35 AM, melolp <melolp at gmail.com> wrote:
>
> Hi all,
>
> I need some help since I'm new using GRASS functions through python.
>
> I'm trying to use the function r.profile.
>
> My code:
>
> from grass.script import raster as grass
>
> os.chdir('F:\GEOSTORM\Python scripts')
>
> 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"

I think that you need something like this (untested):

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

Markus


More information about the grass-dev mailing list