Johannes Radinger wrote:

> I want to use v.distance in a pyton script.
> 
> I try:
>     grass.run_command("v.distance",
>                       flags="o",
>                       from="points",
>                       to="line",
>                       upload="to_x,to_y",
>                       col="to_X,to_Y")
> 
> but I fail because the expression FROM is already
> used by python...
> 
> what is the correct way to handle that problem?

Add a leading underscore:

        _from="points",

If the first character of a keyword is an underscore, it's removed
when generating the argument list. This allows passing arguments which
are Python keywords or which are recognised by the run_command()
function.

Most arguments which are recognised by the Popen() constructor are
passed to Popen() rather than to the program. The argument names
"flags", "overwrite", "quiet" and "verbose" are also treated
specially.

-- 
Glynn Clements <[email protected]>
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to