[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grass-user
Subject:    Re: [GRASS-user] Python scripts- How to call external bin
From:       Glynn Clements <glynn () gclements ! plus ! com>
Date:       2011-06-30 23:34:33
Message-ID: 19981.2057.68211.42580 () cerise ! gclements ! plus ! com
[Download RAW message or body]


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@gclements.plus.com>
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic