I'm a beginner in programming but i have to work with GRASS at work, and do it quickly.

I'm completely lost with all the variety of tutorials that are existing and to me, don't look the same...and nothing of them answer my basic questions (how to make very simple loops on multiple raster).

So I want to clarify where to start and what to use. I'm using GRASS with the 6.4.2 command line, under Windows 7 OS.

I don't know if I have to use Unix syntax or other, and I don't know if I have to directly use the Python shell more than the basic grass shell.

Anybody can help me to get started with very simple tutorials for using shell (loops, work with data from mapsets, using variables, import, export...) ?

1 Answer 1


GRASS is written in C and have a ctypes python lib and recently an improved high level python library called pygrass. see pygrass documentation here. To work with raster data please refer to raster section of pygrass.

I would suggest you to start with python than using shell programming because all shell scripts are ported to python for cross-platform compatibility.

grass is a multi binary package. Each module runs as a separate process. To do an analysis users just call these modules with correct parameters.

These examples shows how to run grass modules by code

  • Thank you Rashad for those informations. These examples are very useful. I have no skills in batch and in C, so It suits me to get into Python.
    – Samy-DT
    Apr 26, 2013 at 4:54
  • Rashad do you know how install pygrass on windows ? I don't find any tutorial about it.
    – Samy-DT
    Apr 26, 2013 at 15:09
  • you can download pygrass source from here code.google.com/p/pygrass/downloads/list and python setup.py install will build and install it on your system. Btw It will be great to have a windows installer. I will inform the guy who developed pygrass about it
    – rkm
    Apr 27, 2013 at 3:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.