Jelajahi Sumber

change Python shebang to python3 (#82)

Markus Neteler 5 tahun lalu
induk
melakukan
428521e58f

+ 1 - 1
display/displaydrivers.html

@@ -27,7 +27,7 @@ defined by this variable. Currently only Python scrips are supported.
 Lets start with simple example of Python script called <i>render.py</i>:
 
 <div class="code"><pre>
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import os
 import sys

+ 1 - 1
doc/python/vector_example_ctypes.py

@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 
 """
 Sample Python script to access vector data using GRASS Ctypes

+ 2 - 2
general/g.parser/g.parser.html

@@ -361,7 +361,7 @@ Parameters:
 <h3>Example code for Python</h3>
 
 <div class="code"><pre>
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # g.parser demo script for python programming
 
@@ -555,7 +555,7 @@ The output is shown below:
 <div class="code"><pre>
 v.what.rast --script
 
-#!/usr/bin/env python
+#!/usr/bin/env python3
 ############################################################################
 #
 # MODULE:       v.what.rast_wrapper

+ 1 - 1
lib/gis/parser_script.c

@@ -27,7 +27,7 @@ void G__script(void)
     char *type;
 
     fprintf(fp,
-	    "#!/usr/bin/env python\n");
+	    "#!/usr/bin/env python3\n");
     fprintf(fp,
 	    "############################################################################\n");
     fprintf(fp, "#\n");

+ 7 - 7
lib/init/grass7.html

@@ -159,13 +159,13 @@ from highest precedence to lowest.
 interface, then the GRASS_PYTHON environment variable can be used to
 override your system default <tt>python</tt> command.
 
-<p>Suppose for example your system has Python 2.6 installed and you
-install a personal version of the Python 2.7 binaries
+<p>Suppose for example your system has Python 3.6 installed and you
+install a personal version of the Python 3.7 binaries
 under <tt>$HOME/bin</tt>. You can use the above variables to have
-GRASS use the Python 2.7 binaries instead.
+GRASS use the Python 3.7 binaries instead.
 
 <div class="code"><pre>
-   GRASS_PYTHON=python2.7
+   GRASS_PYTHON=python3.7
 </pre></div>
 
 <h3>Addon Path to Extra User Scripts</h3>
@@ -331,7 +331,7 @@ grass78 /path/to/grassdata/test1/PERMANENT/ --exec python test.py
 A very simple Python script ("test.py") may look like this:
 
 <div class="code"><pre>
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # import GRASS Python bindings (see also pygrass)
 import grass.script as gscript
@@ -393,7 +393,7 @@ grass78 --tmp-location XY --exec r.neighbors --help
 <h4>Troubleshooting</h4>
 Importantly, to avoid an <tt>"[Errno 8] Exec format error"</tt> there must be a 
 <a href="https://en.wikipedia.org/wiki/Shebang_%28Unix%29">shebang</a> line at the top of
-the script (like <tt>#!/bin/sh</tt>, <tt>#!/bin/bash</tt>, or <tt>#!/usr/bin/env python</tt>)
+the script (like <tt>#!/bin/sh</tt>, <tt>#!/bin/bash</tt>, or <tt>#!/usr/bin/env python3</tt>)
 indicating which interpreter to be used for the script. The script file must 
 have its executable bit set. 
 
@@ -402,7 +402,7 @@ have its executable bit set.
 If you start GRASS using the <em><a href="wxGUI.html">wxGUI</a></em>
 interface you must have a <tt>python</tt> command in your $PATH
 variable. That is, the command must be named
-<tt>python</tt> and not something like <tt>python2.6</tt>. Rarely some
+<tt>python</tt> and not something like <tt>python3.6</tt>. Rarely some
 Python installations do not create a <tt>python</tt> command. In these
 cases you can override <tt>python</tt> by GRASS_PYTHON environmental
 variable.

+ 1 - 1
lib/python/docs/src/script_intro.rst

@@ -93,7 +93,7 @@ Providing GRASS module interface to a script
 
 ::
 
-    #!/usr/bin/env python
+    #!/usr/bin/env python3
 
     #%module
     #% description: Adds the values of two rasters (A + B)

+ 1 - 1
raster/r.solute.transport/r.solute.transport.html

@@ -88,7 +88,7 @@ groundwater flow / solute transport area and data.
 Make sure you are not in a lat/lon projection.
 
 <div class="code"><pre>
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # This is an example script how groundwater flow and solute transport are
 # computed within grass
 import sys