| 1 |
There are two ways of using Python to run GRASS commands: |
| 2 |
(or you could mix them together) |
| 3 |
|
| 4 |
- Module scripting using the grass python helper library and g.parser. |
| 5 |
import grass.script as gs |
| 6 |
For examples see scripts/ in the GRASS 7 source code. |
| 7 |
|
| 8 |
|
| 9 |
- Module creation using hooks into the C library functions using ctypes. |
| 10 |
The scripts in the doc/examples/python/ directory will describe this. |
| 11 |
(Ctypes is standard in Python 2.5 and newer; replaces the SWIG |
| 12 |
implementation in GRASS) |
| 13 |
|
| 14 |
|
| 15 |
More details can be found in the GRASS Programmer's Manual. |