[GRASS-dev] error when running v.distance in python script

Anna Petrášová kratochanna at gmail.com
Fri May 19 06:52:38 PDT 2017


On Fri, May 19, 2017 at 8:50 AM, Paulo van Breugel
<p.vanbreugel at gmail.com> wrote:
> Hi devs
>
> I am trying to use v.distance in a Python script. However, I am getting the
> error
>
> Module("v.distance", from=tmpout3, to=tmp_val, upload="to_attr",
>        column="x", to_column=column)
>   File "<ipython-input-138-da4ba6c2bb80>", line 1
>     Module("v.distance", from=tmpout3, to=tmp_val, upload="to_attr",
>                             ^
> SyntaxError: invalid syntax
>
> If I run the same directly on the command-line it runs without errors.
>
> v.distance from=testmap1 to=testmap2 upload=to_attr column=x to_column=lv
>
> Is this because 'from' is a reserved word perhaps? If so, how do I use this
> in a Python script? Otherwise, any idea what I might be doing wrong?

Try _from or from_ (I am not sure which one is the right one now).

Anna

>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-dev


More information about the grass-dev mailing list