Python Extension

The PCRaster Python Extension is a Python extension which enables you to write PCRaster models in Python. This way, you have two options regarding the language you can use to express your model: the PCRaster environmental modelling language and the Python programming language.

Below is a small code snippet to give you a taste of how it looks to use PCRaster from Python. PCRaster users will note that the syntax is actually very similar to the PCRaster environmental modelling language.

from pcraster import *

gradient = slope("dem.map")
steepSlopes = gradient > 20