[GRASS-dev] [GRASS GIS] #2015: Missing file association dialog pops up all the time

GRASS GIS trac at osgeo.org
Sat Jul 27 05:47:21 PDT 2013


#2015: Missing file association dialog pops up all the time
------------------------+---------------------------------------------------
 Reporter:  wenzeslaus  |       Owner:  grass-dev@…              
     Type:  defect      |      Status:  new                      
 Priority:  normal      |   Milestone:  7.0.0                    
Component:  Python      |     Version:  svn-trunk                
 Keywords:  wingrass    |    Platform:  MSWindows 7              
      Cpu:  All         |  
------------------------+---------------------------------------------------

Comment(by hellik):

 Replying to [comment:4 hellik]:
 > see thread ''[GRASS-dev] Python handling in winGRASS7'' in dev-ML:
 >
 > http://lists.osgeo.org/pipermail/grass-dev/2013-July/065137.html
 > http://lists.osgeo.org/pipermail/grass-dev/2013-July/065140.html
 >
 > and
 >
 > http://docs.python.org/3/using/windows.html#launcher
 >
 > for some hints.

 some quick tests:

 (1) Download Python 3.3.2 Windows x86 MSI Installer

 (2) extract Python 3.3.2 without installing it
 (e.g. msiexec /a C:\dl\testunzip\python-3.3.2.msi /qb
 TARGETDIR=C:\dl\testunzip\uz)

 (3) open a windows console in C:\dl\testunzip\uz and type py --version

 {{{
 C:\dl\testunzip\uz>py --version
 Python 2.7.2
 }}}

 => it's the system wide python 2.7.2 installed by ArcGIS10.1.

 or

 {{{
 C:\dl\testunzip\uz>py --help
 Python Launcher for Windows Version 3.3.2150.1013

 usage: py [ launcher-arguments ] script [ script-arguments ]

 Launcher arguments:

 -2     : Launch the latest Python 2.x version
 -3     : Launch the latest Python 3.x version
 -X.Y   : Launch the specified Python version
 -X.Y-32: Launch the specified 32bit Python version

 The following help text is from Python:

 usage: C:\Python27\ArcGIS10.1\python.exe [option] ... [-c cmd | -m mod |
 file |
 -] [arg] ...
 Options and arguments (and corresponding environment variables):
 -B     : don't write .py[co] files on import; also
 PYTHONDONTWRITEBYTECODE=x
 [...]
 }}}

 (4) script example
 http://docs.python.org/3/using/windows.html#from-a-script

 {{{
 hello.py
 #! python
 import sys
 sys.stdout.write("hello from Python %s\n" % (sys.version,))
 }}}

 {{{
 C:\dl\testunzip\uz>py hello.py
 hello from Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32
 bit (Int
 el)]
 }}}

 (5) put py.ini in the same folder as the windows python launcher py.exe.

 content of py.ini which points to the osgeo4w-bundled python 2.7.4

 {{{
 py.ini
 [commands]
 myprog="C:\OSGeo4W\bin\python.exe"
 }}}

 and change hello.py to

 {{{
 #! myprog
 import sys
 sys.stdout.write("hello from Python %s\n" % (sys.version,))
 }}}

 {{{
 C:\dl\testunzip\uz>py hello.py
 hello from Python 2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32
 bit (Int
 el)]
 }}}

 (6) change py.ini to point to the extracted (not installed) python 3.3.2

 {{{
 py.ini
 [commands]
 myprog="C:\dl\testunzip\uz\python.exe"
 }}}

 {{{
 C:\dl\testunzip\uz>py hello.py
 hello from Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC
 v.1600
  32 bit (Intel)]
 }}}

 it seems to be possible to switch the used python interpreter by using the
 Python Launcher for Windows concept and point to a specfic python
 interpreter (installed or bundled).

 could this help?

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2015#comment:6>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list