diff --git a/Doc/howto/webservers.rst b/Doc/howto/webservers.rst --- a/Doc/howto/webservers.rst +++ b/Doc/howto/webservers.rst @@ -96,7 +96,7 @@ Simple script for testing CGI To test whether your web server works with CGI, you can use this short and simple CGI program:: - #!/usr/bin/env python + #!/usr/bin/env python3 # -*- coding: UTF-8 -*- # enable debugging @@ -186,13 +186,13 @@ Some of these potential problems are: to expect a specific file extension for CGI scripts. * On Unix-like systems, the path to the interpreter in the shebang - (``#!/usr/bin/env python``) must be correct. This line calls + (``#!/usr/bin/env python3``) must be correct. This line calls ``/usr/bin/env`` to find Python, but it will fail if there is no ``/usr/bin/env``, or if Python is not in the web server's path. If you know where your Python is installed, you can also use that full path. The - commands ``whereis python`` and ``type -p python`` could help you find + commands ``whereis python3`` and ``type -p python3`` could help you find where it is installed. Once you know the path, you can change the shebang - accordingly: ``#!/usr/bin/python``. + accordingly: ``#!/usr/bin/python3``. * The file must not contain a BOM (Byte Order Mark). The BOM is meant for determining the byte order of UTF-16 and UTF-32 encodings, but some editors @@ -289,7 +289,7 @@ Each web server requires a specific modu Once you have installed and configured the module, you can test it with the following WSGI-application:: - #!/usr/bin/env python + #!/usr/bin/env python3 # -*- coding: UTF-8 -*- import sys, os diff --git a/Doc/using/unix.rst b/Doc/using/unix.rst --- a/Doc/using/unix.rst +++ b/Doc/using/unix.rst @@ -98,7 +98,7 @@ For example, on most Linux systems, the +-----------------------------------------------+------------------------------------------+ | File/directory | Meaning | +===============================================+==========================================+ -| :file:`{exec_prefix}/bin/python` | Recommended location of the interpreter. | +| :file:`{exec_prefix}/bin/python3` | Recommended location of the interpreter. | +-----------------------------------------------+------------------------------------------+ | :file:`{prefix}/lib/python{version}`, | Recommended locations of the directories | | :file:`{exec_prefix}/lib/python{version}` | containing the standard modules. | @@ -125,11 +125,11 @@ e.g. with :: and put an appropriate Shebang line at the top of the script. A good choice is usually :: - #!/usr/bin/env python + #!/usr/bin/env python3 which searches for the Python interpreter in the whole :envvar:`PATH`. However, some Unices may not have the :program:`env` command, so you may need to hardcode -``/usr/bin/python`` as the interpreter path. +``/usr/bin/python3`` as the interpreter path. To use shell commands in your Python scripts, look at the :mod:`subprocess` module.