FW: [GRASS-user] python interface

Hamish hamish_nospam at yahoo.com
Thu May 18 00:10:06 EDT 2006


> > 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).

It will be interesting to see what new things can be built with the SWIG
interface when combined with the GRASS MinGW Windows port.


Hamish




More information about the grass-user mailing list