<div>Hi Rgurus,</div>
<div> </div>
<div>I am trying to play with grass and python under Msys (windows).</div>
<div>I wrote a silly code, only to test if python can be run fom grass.</div>
<div> </div>
<div>GRASS 6.4.0RC4 (newLocation):~ > cat aaa.py<br>a =1<br>b = "The world is real"<br>print a,b</div>
<div> </div>
<div>GRASS 6.4.0RC4 (newLocation):~ > python aaa.py<br>1 The world is real<br>c:\Python26\lib\site.py:150: Warning: 'with' will become a reserved keyword in Python 2.6<br>'import site' failed; use -v for traceback<br>
</div>
<div>#----</div>
<div>As you can see, I can run the python code from grass, but I receive a warning message.</div>
<div>But when I try to import grass, I get an error message:</div>
<div> </div>
<div>GRASS 6.4.0RC4 (newLocation):~ > cat grass_python_test.py <br>import sys<br>import grass</div>
<div> </div>
<div>GRASS 6.4.0RC4 (newLocation):~ > python grass_python_test.py <br>c:\Python26\lib\site.py:150: Warning: 'with' will become a reserved keyword in Python 2.6<br>'import site' failed; use -v for traceback<br>
Traceback (most recent call last):<br> File "grass_python_test.py", line 2, in <module><br> import grass<br> File "C:\OSGeo4W\apps\grass\grass-6.4.0RC4\etc\python\grass.py", line 1, in <module><br>
import os<br> File "c:\Python26\lib\os.py", line 757<br> bs = b""<br> ^<br>SyntaxError: invalid syntax<br></div>
<div> </div>
<div>Any help are welcome.</div>
<div> </div>
<div>milton</div>