<div>Dear all,</div>
<div> </div>
<div>I am trying to play with grass & python, and I am trying to</div>
<div>reproduce the first example available at </div>
<div><a href="http://grass.osgeo.org/wiki/GRASS_and_Python">http://grass.osgeo.org/wiki/GRASS_and_Python</a></div>
<div>with the following adaptation:</div>
<div>----------------------</div>
<div>#!/usr/bin/env python<br>import sys<br>import grass<br> <br>def main():<br> drape_map = options['MQ_simulation_050001_p023_h007']<br> relief_map = options['MQ_simulation_050010_p010_h013']<br>
brighten = options['brighten']<br> ret = grass.run_command("d.his", h_map = drapemap, i_map = relief_map, brighten = brighten)<br> return 0<br> <br>if __name__ == "__main__":<br> options, flags = grass.parser()<br>
sys.exit(main())</div>
<div>-----------</div>
<div> </div>
<div> </div>
<div>To try this I started MSYS, started GRASS with -gui option,</div>
<div>and then typed the name of the script (python_grass03.py): The error looks like:</div>
<div>----............................</div>
<div>GRASS 6.4.0RC4 (SDB_PL_teste):/c/Data/Paisagens_Simuladas/teste_python > python_grass03.py<br>Traceback (most recent call last):<br> File "./python_grass03.py", line 13, in <module><br> options, flags = grass.parser()<br>
File "C:\OSGeo4W\apps\grass\grass-6.4.0RC4\etc\python\grass.py", line 208, in parser<br> os.execvp("g.parser", [name] + argv)<br> File "c:\Python25\lib\os.py", line 354, in execvp<br> _execvpe(file, args)<br>
File "c:\Python25\lib\os.py", line 390, in _execvpe<br> func(fullname, *argrest)<br>OSError: [Errno 2] No such file or directory<br>----............................</div>
<div> </div>
<div> </div>
<div> </div>
<div>The environment of my grass session looks like</div>
<div>-------------------++++++++++++++++++++</div>
<div>GRASS 6.4.0RC4 (SDB_PL_teste):/c/Data/Paisagens_Simuladas/teste_python > set<br>!::='::\'<br>!C:='C:\'<br>ALLUSERSPROFILE='C:\ProgramData'<br>APPDATA='C:\Users\famiglia\AppData\Roaming'<br>
ARCGISHOME='C:\Program Files (x86)\ArcGIS\'<br>BASH=/bin/sh<br>BASH_VERSINFO=([0]="2" [1]="04" [2]="0" [3]="1" [4]="release" [5]="i686-pc-msys")<br>BASH_VERSION='2.04.0(1)-release'<br>
BGCOLOR=LightYellow<br>COLORFGBG='default;default'<br>COLORTERM=rxvt<br>COLUMNS=97<br>COMMONPROGRAMFILES='C:\Program Files (x86)\Common Files'<br>COMMONPROGRAMFILES(X86)='C:\Program Files (x86)\Common Files'<br>
COMMONPROGRAMW6432='C:\Program Files\Common Files'<br>COMPUTERNAME=FAMIGLIA-PC<br>COMSPEC='C:\Windows\SysWOW64\cmd.exe'<br>DFSTRACINGON=FALSE<br>DIRSTACK=()<br>DISPLAY=:0<br>EUID=500<br>FGCOLOR=Navy<br>FP_NO_HOST_CHECK=NO<br>
GDAL_DATA='C:\OSGeo4W\share\gdal'<br>GEOTIFF_CSV='C:\OSGeo4W\share\epsg_csv'<br>GISBASE=/c/OSGeo4W/apps/grass/grass-6.4.0RC4<br>GISRC=/tmp/grass6-famiglia-6244/gisrc<br>GIS_LOCK=6244<br>GRASS_GNUPLOT='gnuplot -persist'<br>
GRASS_HTML_BROWSER='C:\Program Files (x86)\Internet Exporer\iexplore'<br>GRASS_LD_LIBRARY_PATH='/c/OSGeo4W/apps/grass/grass-6.4.0RC4/lib:/c/OSGeo4W/bin:/c/OSGeo4W/apps/grass/grass-6.4.0RC4/bin:/c/OSGeo4W/apps/grass/grass-6.4.0RC4/scripts:.:/usr/local/bin:/mingw/bin:/bin:/osgeo4w/bin:/osgeo4w/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/c/Python26:/c/gdalwin32-1.6/bin:/c/msys/1.0:/c/msys/1.0/bin:/c/Program Files (x86)/Java/jre6/bin:/bin:/bin'<br>
GRASS_PAGER=less<br>GRASS_PERL=no<br>GRASS_PROJSHARE='C:\OSGeo4W\share\proj'<br>GRASS_PYTHON=python<br>GRASS_SH=/bin/sh<br>GRASS_TCLSH=tclsh<br>GRASS_VERSION=6.4.0RC4<br>GRASS_WISH=/c/OSGeo4W/bin/wish.exe<br>GROUPS=()<br>
HISTFILE=/c/Users/famiglia/.bash_history<br>HISTFILESIZE=500<br>HISTSIZE=500<br>HOME=/c/Users/famiglia<br>HOMEDRIVE=C:<br>HOMEPATH='\'<br>HOSTNAME=FAMIGLIA-PC<br>HOSTTYPE=i686<br>IFS=' <br>'<br>LINES=45<br>
LOCALAPPDATA='C:\Users\famiglia\AppData\Local'<br>LOGNAME=famiglia<br>LOGONSERVER='\\FAMIGLIA-PC'<br>MACHTYPE=i686-pc-msys<br>MAILCHECK=60<br>MAKE_MODE=unix<br>MINGW32BGCOLOR=LightYellow<br>MINGW32FGCOLOR=Navy<br>
MSYSBGCOLOR=White<br>MSYSCON=rxvt.exe<br>MSYSFGCOLOR=Black<br>MSYSTEM=MINGW32<br>NUMBER_OF_PROCESSORS=4<br>OLDPWD=/usr/bin<br>OPTERR=1<br>OPTIND=1<br>OS=Windows_NT<br>OSGEO4W_ROOT='C:\OSGeo4W'<br>OSTYPE=msys<br>PATH='/c/OSGeo4W/apps/grass/grass-6.4.0RC4/lib:/c/OSGeo4W/bin:/c/OSGeo4W/apps/grass/grass-6.4.0RC4/bin:/c/OSGeo4W/apps/grass/grass-6.4.0RC4/scripts:.:/usr/local/bin:/mingw/bin:/bin:/osgeo4w/bin:/osgeo4w/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/c/Python26:/c/gdalwin32-1.6/bin:/c/msys/1.0:/c/msys/1.0/bin:/c/Program Files (x86)/Java/jre6/bin:/bin:/bin'<br>
PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'<br>PIPESTATUS=([0]="1")<br>PPID=6244<br>PROCESSOR_ARCHITECTURE=x86<br>PROCESSOR_ARCHITEW6432=AMD64<br>PROCESSOR_IDENTIFIER='Intel64 Family 6 Model 23 Stepping 10, GenuineIntel'<br>
PROCESSOR_LEVEL=6<br>PROCESSOR_REVISION=170a<br>PROGRAMDATA='C:\ProgramData'<br>PROGRAMFILES='C:\Program Files (x86)'<br>PROGRAMFILES(X86)='C:\Program Files (x86)'<br>PROGRAMW6432='C:\Program Files'<br>
PROJ_LIB='C:\OSGeo4W\share\proj'<br>PROMPT='$P$G'<br>PS1='GRASS 6.4.0RC4 (SDB_PL_teste):\w > '<br>PS2='> '<br>PS4='+ '<br>PUBLIC='C:\Users\Public'<br>PWD=/c/Data/Paisagens_Simuladas/teste_python<br>
PYTHONHOME=/c/OSGeo4W/apps/grass/grass-6.4.0RC4/etc/python:/c/Python25<br>PYTHONPATH='/c/OSGeo4W/apps/grass/grass-6.4.0RC4/etc/python:/c/Python25:C:\Python25\;C:\Program Files (x86)\ArcGIS\bin;C:\OSGeo4W\apps\grass\grass-6.4.0RC4\etc\python'<br>
SESSIONNAME=Console<br>SHELL=/bin/sh<br>SHELLOPTS=braceexpand:hashall:histexpand:monitor:history:interactive-comments:emacs<br>SHLVL=4<br>SYSTEMDRIVE=C:<br>SYSTEMROOT='C:\Windows'<br>TEMP=/tmp<br>TERM=msys<br>TMP=/tmp<br>
TRACE_FORMAT_SEARCH_PATH='\\<a href="http://NTREL202.ntdev.corp.microsoft.com">NTREL202.ntdev.corp.microsoft.com</a>\34FB5F65-FFEB-4B61-BF0E-A6A76C450FAA\TraceFormat'<br>UID=500<br>USERDOMAIN=famiglia-PC<br>USERNAME=famiglia<br>
USERPROFILE='C:\Users\famiglia'<br>WD='C:\OSGeo4W\apps\msys\\bin\'<br>WINDIR='C:\Windows'<br>WINDOWID=167838960<br>_=python_grass03.py</div>
<div>-------------------++++++++++++++++++++</div>
<div> </div>
<div>I am running GRASS 6.4R4 under MSYS and VISTA.</div>
<div> </div>
<div>Any hint are welcome.</div>
<div> </div>
<div>bests</div>
<div>milton</div>
<div> </div>