[GRASS-user] Python scripts- How to call external bin

katrin eggert katrineggert1980 at gmail.com
Mon Jul 4 06:50:15 EDT 2011


Hello Glynn
Just one question: I reading
http://grass.osgeo.org/programming6/pythonlib.html the "*GRASS-oriented
interface to subprocess module" and I'm wondering wich one of this functions
shall i use to run an external bin in Windows? run_command?*
*Thanks
*
*
*
2011/7/1 Glynn Clements <glynn at gclements.plus.com>

>
> katrin eggert wrote:
>
> > I want to integrate in a Python script a call to an external binary (a
> small
> > fucntion that I have done). What can i use to do this?
>
> The standard Python functions for spawning child processes are
> subprocess.Popen() and subprocess.call()
>
>        http://docs.python.org/library/subprocess.html
>
> The grass.script module has its own versions of these functions, which
> set shell=True on Windows so that scripts work, but that doesn't
> matter if you're running a binary executable. It also has several
> functions which are intended specifically for running GRASS modules
> (anything that uses the GRASS command-line parser).
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20110704/5a0d83ee/attachment.html


More information about the grass-user mailing list