Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change Python shebang to python3 #82

Merged
merged 1 commit into from Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion display/displaydrivers.html
Expand Up @@ -27,7 +27,7 @@ <h3>GRASS_RENDER_COMMAND</h3>
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
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down
4 changes: 2 additions & 2 deletions general/g.parser/g.parser.html
Expand Up @@ -361,7 +361,7 @@ <h2>EXAMPLES</h2>
<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

Expand Down Expand Up @@ -555,7 +555,7 @@ <h3>Easy creation of a script</h3>
<div class="code"><pre>
v.what.rast --script

#!/usr/bin/env python
#!/usr/bin/env python3
############################################################################
#
# MODULE: v.what.rast_wrapper
Expand Down
2 changes: 1 addition & 1 deletion lib/gis/parser_script.c
Expand Up @@ -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");
Expand Down
14 changes: 7 additions & 7 deletions lib/init/grass7.html
Expand Up @@ -159,13 +159,13 @@ <h3>Python Environment Variables</h3>
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>
Expand Down Expand Up @@ -331,7 +331,7 @@ <h4>Execution of shell and Python scripts instead of single commands</h4>
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
Expand Down Expand Up @@ -393,7 +393,7 @@ <h4>Using temporary location</h4>
<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.

Expand All @@ -402,7 +402,7 @@ <h2>CAVEAT</h2>
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.
Expand Down
2 changes: 1 addition & 1 deletion lib/python/docs/src/script_intro.rst
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion raster/r.solute.transport/r.solute.transport.html
Expand Up @@ -88,7 +88,7 @@ <h2>EXAMPLE</h2>
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
Expand Down