FW: [GRASS-user] python interface

Andrew MacIntyre Andrew.MacIntyre at acma.gov.au
Wed May 17 21:56:49 EDT 2006


> From: David Finlayson
> Sent: Thursday, 18 May 2006 4:05 AM

{...}

> Unfortunately, Python doesn't have a SWIG interface yet to the GRASS 
> API, so it cannot interface with GRASS at a more atomic level.
> Currently, you can only do that with C. I think once, the C API 
> settles down I will try my hand at creating a SWIG interface to GRASS.
> My vision is to have a simplified object model that would allow 
> non-experts to program cool tools for GRASS.

You may find Thomas Heller's ctypes module of interest, certainly as a 
prototyping tool if not in heavy duty usage (where a fully integrated 
extension will have better performance).

See http://starship.python.net/crew/theller/ctypes/

It works on Windows, OS/X, Solaris and Linux/*BSD at least (not sure 
about Cygwin), and will be included with Python 2.5 when that is 
released later this year.  There are tools that can compile pure 
Python modules from C header files for use with ctypes, though at 
the moment these are a bit fiddly to get installed (see the 
codegenerator page on the above site).

-------------------------> "These thoughts are mine alone!" <---------
Andrew MacIntyre           National Licensing and Allocations Branch
tel:   +61 2 6256 2812     Inputs to Industry Division
fax:   +61 2 6253 3277     Australian Communications & Media Authority
email: andrew.macintyre at acma.gov.au 




More information about the grass-user mailing list