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: r.basin for windows [was Re: WinGrass6.5.svn-installer with selected addons] (Glynn Clements) 2. Re: r.basin for windows [was Re: WinGrass6.5.svn-installer with selected addons] (Helmut Kudrnovsky) 3. Re: r.basin for windows [was Re: WinGrass6.5.svn-installer with selected addons] (Glynn Clements) ---------------------------------------------------------------------- Message: 1 Date: Sat, 22 Oct 2011 20:10:19 +0100 From: Glynn Clements <gl...@gclements.plus.com> Subject: [GRASS-windows] Re: r.basin for windows [was Re: WinGrass6.5.svn-installer with selected addons] To: Helmut Kudrnovsky <hel...@web.de> Cc: grass-windows@lists.osgeo.org Message-ID: <20131.5403.428714.370...@cerise.gclements.plus.com> Content-Type: text/plain; charset=us-ascii Helmut Kudrnovsky wrote: > I've tried all this above with a corresponding r.basin.bat, r.wf.bat and > r.ipso.bat in C:\Program Files\GRASS 6.5.SVN\bin (the python-scripts > r.basin.py, r.wf.py, r.ipso.py are in C:\Program Files\GRASS > 6.5.SVN\scripts). > > but I'm not sure the content of r.basin.bat should > > @"%GRASS_PYTHON%" "%GISBASE%\scripts\r.basin.py" %* > or > @"%GRASS_PYTHON%" "%GISBASE%/scripts/r.basin.py" %* Either should work, but the former is preferable. Both cmd.exe and %GRASS_PYTHON% will be native Windows programs, so they'll prefer backslashes to forward slashes in the event that it makes a difference. > >> is it possible to test which python interpreter is associated with the > >> .py-extension? > > > >Create a Python script (with a .py extension) which prints useful > >information (e.g. sys.prefix, sys.path, sys.version, etc), then > >"execute" it via any native interface, e.g. system() in C, os.system() > >or subprocess.Popen(..., shell=True) in Python, or "cmd /c ..." from a > >shell script. > > > >The "sys" module is part of the main Python DLL, so it isn't affected > >by PYTHONHOME and PYTHONPATH. > > my little python-testscript is: > testpython.py > #!/usr/bin/env python > import sys > print sys.prefix > print > print sys.path > print > print sys.version > > (1) in the wingrass-msys-shell within a grass-session: > (2) in a windows command line outside any grass-session: Neither of these cases matter. What matters is e.g.: cmd /c testpython Using a .bat file to force the use of %GRASS_PYTHON% is fine if you can be sure that the .bat file will always be used. -- Glynn Clements <gl...@gclements.plus.com> ------------------------------ Message: 2 Date: Sat, 22 Oct 2011 13:26:18 -0700 (PDT) From: Helmut Kudrnovsky <hel...@web.de> Subject: [GRASS-windows] Re: r.basin for windows [was Re: WinGrass6.5.svn-installer with selected addons] To: grass-windows@lists.osgeo.org Message-ID: <1319315178891-6920884.p...@n2.nabble.com> Content-Type: text/plain; charset=us-ascii >> @"%GRASS_PYTHON%" "%GISBASE%\scripts\r.basin.py" %* >> or >> @"%GRASS_PYTHON%" "%GISBASE%/scripts/r.basin.py" %* > >Either should work, but the former is preferable. Both cmd.exe and >%GRASS_PYTHON% will be native Windows programs, so they'll prefer >backslashes to forward slashes in the event that it makes a >difference. ok >> (2) in a windows command line outside any grass-session: > >Neither of these cases matter. What matters is e.g.: > > cmd /c testpython let's test this in a wingrass-msys-shell within a grass-session: GRASS 6.5> cmd /c testpython C:\Program Files\GRASS 6.5.SVN\Python25 ['C:\\Users\\syringia', 'c:\\Program Files\\GRASS 6.5.SVN\\etc\\python', 'c:\\Program Files\\GRASS 6.5.SVN\\Python25', 'C:\\windows\\system32\\python26.zip', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\DLLs', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\plat-win', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\lib-tk', 'C:\\Python26\\ArcGIS10.0', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\site-packages', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\site-packages\\win32', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\site-packages\\win32\\lib', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\site-packages\\Pythonwin', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\site-packages\\wx-2.8-msw-unicode'] 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] GRASS 6.5> ok, there seems to be a mixing... 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] is from C:\Python26\ArcGIS10.0 and not the wingrass-bundled python in C:\Program Files\GRASS 6.5.SVN\Python25 maybe we should add this little testscript to the wiki? >Using a .bat file to force the use of %GRASS_PYTHON% is fine if you >can be sure that the .bat file will always be used. ok, but for this my insight in wxgui and/or wingrass-(msys)command-line invoking bat-scripts isn't enough to be sure. any hints to look where in the source? thanks Helmut -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/WinGrass6-5-svn-installer-with-selected-addons-tp6873977p6920884.html Sent from the Grass - Win mailing list archive at Nabble.com. ------------------------------ Message: 3 Date: Sun, 23 Oct 2011 14:36:08 +0100 From: Glynn Clements <gl...@gclements.plus.com> Subject: [GRASS-windows] Re: r.basin for windows [was Re: WinGrass6.5.svn-installer with selected addons] To: Helmut Kudrnovsky <hel...@web.de> Cc: grass-windows@lists.osgeo.org Message-ID: <20132.6216.67382.773...@cerise.gclements.plus.com> Content-Type: text/plain; charset=us-ascii Helmut Kudrnovsky wrote: > > Neither of these cases matter. What matters is e.g.: > > > > cmd /c testpython > > let's test this in a wingrass-msys-shell within a grass-session: > > GRASS 6.5> cmd /c testpython > C:\Program Files\GRASS 6.5.SVN\Python25 This indicates that PYTHONHOME is pointing at the bundled version. > 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] > GRASS 6.5> This indicates that the Python interpreter is the installed version. My guess is that the command is executing the .py file directly, rather than the batch file. Is %GISBASE%\scripts in the path? -- 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 60, Issue 19 *********************************************