<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Dear Glynn,<br>
<br>
I am always interested in GRASS scripting-related questions. Thanks for
your support on Python/Windows issues.<br>
<br>
<blockquote type="cite">
  <pre wrap="">From: Glynn Clements <a class="moz-txt-link-rfc2396E"
 href="mailto:glynn@gclements.plus.com">&lt;glynn@gclements.plus.com&gt;</a>
Subject: Re: [GRASS-user] Problem with running Python script in GRASS
To: LeeDaniel <a class="moz-txt-link-rfc2396E"
 href="mailto:Lee.Daniel.1986@gmail.com">&lt;Lee.Daniel.1986@gmail.com&gt;</a>
Cc: <a class="moz-txt-link-abbreviated"
 href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
Message-ID: <a class="moz-txt-link-rfc2396E"
 href="mailto:19426.59411.559013.36727@cerise.gclements.plus.com">&lt;19426.59411.559013.36727@cerise.gclements.plus.com&gt;</a>
Content-Type: text/plain; charset=us-ascii


LeeDaniel wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap=""><span class="moz-txt-citetags">&gt; </span>I've written a Python script, doing my best to use the Python I know and
<span class="moz-txt-citetags">&gt; </span>reverse engineer the python scripts I found in the Internet. As far as I can
<span class="moz-txt-citetags">&gt; </span>tell, the script should be fine, although I naturally can't execute it
<span class="moz-txt-citetags">&gt; </span>independently. [...]</pre>
  </blockquote>
  <pre wrap=""><!---->
Windows, Python and 6.4 isn't the most reliable combination.

At a minimum, you need a fairly recent version of 6.5 to be able to
use Python scripts on Windows (the hacks required to get shell scripts
to work on Windows get in the way of running other scripts). 6.4.0-RC6
won't work (g.parser was updated, but lib/python wasn't).
  </pre>
</blockquote>
<br>
Is this true also for the daily WinGRASS-6.4.SVN at
<a class="moz-txt-link-freetext" href="http://josef.fsv.cvut.cz/wingrass/">http://josef.fsv.cvut.cz/wingrass/</a> and will this hold true for 6.4 in
general?<br>
<br>
<blockquote type="cite">
  <pre wrap="">
You also need a "clean" Python install with the correct registry
entries, </pre>
</blockquote>
>From what you say, one needs two Python installations: the one that
comes with GRASS and an additional "fresh" one -- is it ok to install
the current Python 2.6.5 version or 2.5 is better (2.6 seems to be ok
from <a class="moz-txt-link-freetext" href="http://grass.osgeo.org/wiki/GRASS_and_Python">http://grass.osgeo.org/wiki/GRASS_and_Python</a>)? From the
GRASS/Python wiki one also infers that on Windows the Python binaries
that come with the GRASS installation are no longer used (?). <br>
<br>
(Currently I am using WinGRASS-6.4.SVN-r42046-1 from the installer
downloaded at the link above; OS is windows 7.)<br>
<br>
<blockquote type="cite">
  <pre wrap="">and you may need to hack the GRASS startup scripts (the
WinGRASS installer fails quite badly with regard to Python, and the
OSGeo4W installer fails even harder).
  </pre>
</blockquote>
<br>
But my question is actually: if a user wants to take a (Windows) Python
scripting approach to GRASS, what version should she/he target? My
impression is that trying to build functionality using GRASS 7 may have
the best returns, although I am not sure how feasible is that right
now, i.e. what GRASS 6 functionality can currently be ported to GRASS 6
(I am thinking for example to a way around the display issue that in
6.4 is solved using appropriate settings for e.g.
GRASS_RENDER_IMMEDIATE).<br>
<br>
Given that WinGRASS users have the extreme luxury of 7.0.svn snapshot
installers being built almost daily thanks to Martin Landa:<br>
<a class="moz-txt-link-freetext" href="http://josef.fsv.cvut.cz/wingrass/grass70/">http://josef.fsv.cvut.cz/wingrass/grass70/</a><br>
<br>
it would be very interesting to know your opinion.<br>
<br>
Kind regards and thank you in advance,<br>
<br>
Luigi<br>
<br>
<blockquote type="cite">
  <pre wrap="">
<div class="moz-txt-sig">-- 
Glynn Clements <a class="moz-txt-link-rfc2396E"
 href="mailto:glynn@gclements.plus.com">&lt;glynn@gclements.plus.com&gt;</a></div></pre>
</blockquote>
</body>
</html>