Vaclav Petras 635224115c parser: Use #-space-% to allow writing PEP8-compliant Python code (#1287) 4 years ago
..
script 635224115c parser: Use #-space-% to allow writing PEP8-compliant Python code (#1287) 4 years ago
README 0a5097cd0e doc: Use gs as alias for grass.script in doc (#282) 4 years ago
m.distance.py 635224115c parser: Use #-space-% to allow writing PEP8-compliant Python code (#1287) 4 years ago
raster_example_ctypes.py a31838666e Fix SyntaxError issues with Python 3. (#549) 5 years ago
vector_example_ctypes.py a31838666e Fix SyntaxError issues with Python 3. (#549) 5 years ago

README

There are two ways of using Python to run GRASS commands:
(or you could mix them together)

- Module scripting using the grass python helper library and g.parser.
import grass.script as gs
For examples see scripts/ in the GRASS 7 source code.


- Module creation using hooks into the C library functions using ctypes.
The scripts in the doc/python/examples/ directory will describe this.
(Ctypes is standard in Python 2.5 and newer; replaces the SWIG
implementation in GRASS)


More details can be found in the GRASS Programmer's Manual.