Python scripting under GRASS GIS

It was few months ago when I using GRASS last time. Since then there was few things that came in my mind about scripting. I discovered, that it was very easy building and launching bash scripts under windows environment, but I never tried Python.
Today, just accidentally, I was starting to think about it again, and discover, that it is not as easy as bashing, but very close.
The first thing was - install Python. In my case I was using Python 2.7.
The second - to set neccessary environmental variables.
And here comes where attention is needed.
In GRASS GIS homepage there are some samples using environmental variables, but it is possible, that user`s machine/computer is differentely configured.

So, here they are:

GISRC= C:\Documents and Settings\user\.grassrc6
PATH= C:\GRASS-64\etc;C:\GRASS-64\etc\python;C:\GRASS-64\lib;C:\GRASS-64\bin;C:\GRASS-64\extralib;C:\GRASS-64\msys\bin;C:\Python26;
PYTHONLIB= C:\Python26
PYTHONPATH= C:\GRASS-64\etc\python
GRASS_SH= C:\GRASS-64\msys\bin\sh.exe

1st - Drive letter. In my case it`s D:\
2nd - user. Usually it is the name of user.
3rd - Where the GRASS is stored
4th - Where the Python is stored
5th - What version of Python is used.

That`s it.

Nav komentāru:

Ierakstīt komentāru