Send grass-windows mailing list submissions to grass-windows@lists.osgeo.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.osgeo.org/mailman/listinfo/grass-windows or, via email, send a message with subject or body 'help' to grass-windows-requ...@lists.osgeo.org You can reach the person managing the list at grass-windows-ow...@lists.osgeo.org When replying, please edit your Subject line so it is more specific than "Re: Contents of grass-windows digest..." Today's Topics: 1. Re: [GRASS-user] Re: [GRASS-windows] WinGRASS Python 2.7 (Glynn Clements) ---------------------------------------------------------------------- Message: 1 Date: Thu, 8 Sep 2011 08:43:50 +0100 From: Glynn Clements <gl...@gclements.plus.com> Subject: Re: [GRASS-user] Re: [GRASS-windows] WinGRASS Python 2.7 To: "Johannes Radinger" <jradin...@gmx.at> Cc: grass-u...@lists.osgeo.org, grass-windows@lists.osgeo.org Message-ID: <20072.29238.939341.456...@cerise.gclements.plus.com> Content-Type: text/plain; charset=us-ascii Johannes Radinger wrote: > So what I tried now were three different settings in the env.bat Ugh. Init.bat ignores GRASS_PYTHON and just uses "python": python "%GISBASE%/etc/wxpython/gis_set.py" if %errorlevel% == 2 goto exitinit python "%GISBASE%/etc/wxpython/wxgui.py" That should probably be: "%GRASS_PYTHON%" "%GISBASE%/etc/wxpython/gis_set.py" if %errorlevel% == 2 goto exitinit "%GRASS_PYTHON%" "%GISBASE%/etc/wxpython/wxgui.py" GRASS_PYTHON is honoured by g.gui, the dialogs generated by the parser, and the Unix start-up script, but not by Init.bat. > Just to inform you why I need that: I wrote a .py script (including > g.parser elements) which I want to call inside GRASS with "file.py" Note that if you add .PY to PATHEXT, e.g.: set PATHEXT=%PATHEXT%;.PY you can omit the ".py" suffix when running the script. This is the preferred approach, for portability reasons. In 7.0 (where the shell scripts have been replaced with Python scripts), the scripts are installed with the .py suffix on Windows but without the suffix on Unix. So the only portable way to run a Python script is to omit the suffix and to rely upon PATHEXT on Windows. > (like any other modules e.g. r.fuzzy etc.) The script is working > (tested on my Mac using GRASS in combination with Python 2.7)! The > script calls scipy which can only be used in combination with Python > 2.6 or newer (so far as I remember). Note that the Python version used for scripts isn't tied to the version used for the GUI or for the parameter dialogs (in fact, if GRASS_GUI is set to tcltk, even Python scripts will use Tcl/Tk for the parameter dialogs). GRASS_PYTHON is only for the GUI and the parameter dialogs. It exists because the GUI originally needed to use a specific version of Python (for compatibility with binary components) which might not be the "system" version. On Unix (and from MSys' bash on Windows), scripts use the program specified in the #! line (for "#!/usr/bin/env python", this will be the first version found in the path). On Windows, they use the file association. -- Glynn Clements <gl...@gclements.plus.com> ------------------------------ _______________________________________________ grass-windows mailing list grass-windows@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-windows End of grass-windows Digest, Vol 59, Issue 6 ********************************************