Fix current name of the Python 3 binary on Unix (#12896).
Also fix some markup and typos.
This commit is contained in:
parent
4eb0e73ff2
commit
eb933de807
|
@ -1,4 +1,4 @@
|
|||
.. highlightlang:: none
|
||||
.. highlightlang:: sh
|
||||
|
||||
.. _using-on-unix:
|
||||
|
||||
|
@ -55,8 +55,8 @@ On FreeBSD and OpenBSD
|
|||
On OpenSolaris
|
||||
--------------
|
||||
|
||||
To install the newest Python versions on OpenSolaris, install blastwave
|
||||
(http://www.blastwave.org/howto.html) and type "pkg_get -i python" at the
|
||||
To install the newest Python versions on OpenSolaris, install `blastwave
|
||||
<http://www.blastwave.org/howto.html>`_ and type ``pkg_get -i python`` at the
|
||||
prompt.
|
||||
|
||||
|
||||
|
@ -65,22 +65,23 @@ Building Python
|
|||
|
||||
If you want to compile CPython yourself, first thing you should do is get the
|
||||
`source <http://python.org/download/source/>`_. You can download either the
|
||||
latest release's source or just grab a fresh `checkout
|
||||
<http://www.python.org/dev/faq/#how-do-i-get-a-checkout-of-the-repository-read-only-and-read-write>`_.
|
||||
latest release's source or just grab a fresh `clone
|
||||
<http://docs.python.org/devguide/setup#getting-the-source-code>`_. (If you want
|
||||
to contribute patches, you will need a clone.)
|
||||
|
||||
The build process consists the usual ::
|
||||
The build process consists in the usual ::
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
invocations. Configuration options and caveats for specific Unix platforms are
|
||||
extensively documented in the :file:`README` file in the root of the Python
|
||||
extensively documented in the :source:`README` file in the root of the Python
|
||||
source tree.
|
||||
|
||||
.. warning::
|
||||
|
||||
``make install`` can overwrite or masquerade the :file:`python` binary.
|
||||
``make install`` can overwrite or masquerade the :file:`python3` binary.
|
||||
``make altinstall`` is therefore recommended instead of ``make install``
|
||||
since it only installs :file:`{exec_prefix}/bin/python{version}`.
|
||||
|
||||
|
@ -98,7 +99,7 @@ For example, on most Linux systems, the default for both is :file:`/usr`.
|
|||
+-----------------------------------------------+------------------------------------------+
|
||||
| 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. |
|
||||
|
@ -108,10 +109,6 @@ For example, on most Linux systems, the default for both is :file:`/usr`.
|
|||
| | developing Python extensions and |
|
||||
| | embedding the interpreter. |
|
||||
+-----------------------------------------------+------------------------------------------+
|
||||
| :file:`~/.pythonrc.py` | User-specific initialization file loaded |
|
||||
| | by the user module; not used by default |
|
||||
| | or by most applications. |
|
||||
+-----------------------------------------------+------------------------------------------+
|
||||
|
||||
|
||||
Miscellaneous
|
||||
|
@ -125,11 +122,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.
|
||||
|
||||
|
|
Loading…
Reference in New Issue