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

Daniel Victoria daniel.victoria at gmail.com
Mon Jul 4 20:36:20 EDT 2011


Not a very happy observation but did you look at the Subprocess manual
page on the Python web site? This is the main reference for the
module...

http://docs.python.org/library/subprocess.html

On Mon, Jul 4, 2011 at 6:29 PM, katrin eggert
<katrineggert1980 at gmail.com> wrote:
> Hello
> In this case is an external binary written in C. So I will shall use the
>  subprocess.Popen() right?. Besides that general page you gave me, do you
> know any other page that explains, in a easier way, thje use and
> parameterizayion of subprocess.Popen()?
> Thanks
> Kat
>
> 2011/7/4 Glynn Clements <glynn at gclements.plus.com>
>>
>> katrin eggert wrote:
>>
>> > 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?*
>>
>> Does the external program use the GRASS parser? If it doesn't, you
>> shouldn't use any of those functions; just use subprocess.Popen().
>>
>> If it uses the parser, then the correct command to use depends upon
>> how you wish to interact with the child process. Read each of their
>> descriptions to determine which is appropriate.
>>
>> All of them (except for exec_command) are simple wrappers around
>> start_command, which itself just uses make_command to construct a
>> suitable argument list to pass to Popen().
>>
>> --
>> Glynn Clements <glynn at gclements.plus.com>
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
>


More information about the grass-user mailing list