Prep for Python 3.1!

This commit is contained in:
Barry Warsaw 2008-12-03 16:46:14 +00:00
parent 815427c481
commit 97f005d137
12 changed files with 1444 additions and 1432 deletions

View file

@ -10,11 +10,11 @@ Using the Python Interpreter
Invoking the Interpreter
========================
The Python interpreter is usually installed as :file:`/usr/local/bin/python3.0`
The Python interpreter is usually installed as :file:`/usr/local/bin/python3.1`
on those machines where it is available; putting :file:`/usr/local/bin` in your
Unix shell's search path makes it possible to start it by typing the command ::
python3.0
python3.1
to the shell. [#]_ Since the choice of the directory where the interpreter lives
is an installation option, other places are possible; check with your local
@ -22,11 +22,11 @@ Python guru or system administrator. (E.g., :file:`/usr/local/python` is a
popular alternative location.)
On Windows machines, the Python installation is usually placed in
:file:`C:\\Python30`, though you can change this when you're running the
:file:`C:\\Python31`, though you can change this when you're running the
installer. To add this directory to your path, you can type the following
command into the command prompt in a DOS box::
set path=%path%;C:\python30
set path=%path%;C:\python31
Typing an end-of-file character (:kbd:`Control-D` on Unix, :kbd:`Control-Z` on
Windows) at the primary prompt causes the interpreter to exit with a zero exit
@ -101,13 +101,13 @@ with the *secondary prompt*, by default three dots (``...``). The interpreter
prints a welcome message stating its version number and a copyright notice
before printing the first prompt::
$ python3.0
Python 3.0a1 (py3k, Sep 12 2007, 12:21:02)
$ python3.1
Python 3.1a1 (py3k, Sep 12 2007, 12:21:02)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
.. XXX update for final release of Python 3.0
.. XXX update for final release of Python 3.1
Continuation lines are needed when entering a multi-line construct. As an
example, take a look at this :keyword:`if` statement::
@ -155,7 +155,7 @@ Executable Python Scripts
On BSD'ish Unix systems, Python scripts can be made directly executable, like
shell scripts, by putting the line ::
#! /usr/bin/env python3.0
#! /usr/bin/env python3.1
(assuming that the interpreter is on the user's :envvar:`PATH`) at the beginning
of the script and giving the file an executable mode. The ``#!`` must be the
@ -243,7 +243,7 @@ in the script::
.. rubric:: Footnotes
.. [#] On Unix, the 3.0 interpreter is by default not installed with the
.. [#] On Unix, the 3.1 interpreter is by default not installed with the
executable named ``python``, so that it does not conflict with a
simultaneously installed Python 2.x executable.