[GRASS-user] Call an external function from GRASS-Pythons Scripts

Martin Landa landa.martin at gmail.com
Thu Apr 22 08:21:08 EDT 2010


Hi,

2010/4/22 Martin Landa <landa.martin at gmail.com>:
>>> > would have to do this:
>>> > grass.call(['whoami', 'input_file', 'output_file']) or
>>> > grass.call(['whoami input output_file'])
>
> if the syntax is 'cmd input output' then
>
> grass.call(['cmd', 'input', 'output'])
>
> see
>
> http://docs.python.org/library/subprocess.html#subprocess.Popen

or check existing GRASS scripts, e.g.

http://trac.osgeo.org/grass/browser/grass/trunk/scripts/v.in.e00/v.in.e00.py#L135

Martin

-- 
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa


More information about the grass-user mailing list