Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e2ad6c

Browse files
mrh1997zooba
authored andcommitted
bpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849)
Since bpo-30291 it is possible to specify the architecture of Python when using the launcher
1 parent 472f794 commit 1e2ad6c

2 files changed

Lines changed: 24 additions & 13 deletions

File tree

Doc/using/windows.rst

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ of available options is shown below.
154154
| DefaultJustForMeTargetDir | The default install directory for | :file:`%LocalAppData%\\\ |
155155
| | just-for-me installs | Programs\\PythonXY` or |
156156
| | | :file:`%LocalAppData%\\\ |
157-
| | | Programs\\PythonXY-32` |
157+
| | | Programs\\PythonXY-32` or|
158+
| | | :file:`%LocalAppData%\\\ |
159+
| | | Programs\\PythonXY-64` |
158160
+---------------------------+--------------------------------------+--------------------------+
159161
| DefaultCustomTargetDir | The default custom install directory | (empty) |
160162
| | displayed in the UI | |
@@ -762,9 +764,16 @@ on Windows which you hope will be useful on Unix, you should use one of the
762764
shebang lines starting with ``/usr``.
763765

764766
Any of the above virtual commands can be suffixed with an explicit version
765-
(either just the major version, or the major and minor version) - for example
766-
``/usr/bin/python2.7`` - which will cause that specific version to be located
767-
and used.
767+
(either just the major version, or the major and minor version).
768+
Furthermore the 32-bit version can be requested by adding "-32" after the
769+
minor version. I.e. ``/usr/bin/python2.7-32`` will request usage of the
770+
32-bit python 2.7.
771+
772+
.. versionadded:: 3.7
773+
774+
Beginning with python launcher 3.7 it is possible to request 64-bit version
775+
by the "-64" suffix. Furthermore it is possible to specify a major and
776+
architecture without minor (i.e. ``/usr/bin/python3-64``).
768777

769778
The ``/usr/bin/env`` form of shebang line has one further special property.
770779
Before looking for installed Python interpreters, this form will search the
@@ -806,17 +815,18 @@ Customizing default Python versions
806815
In some cases, a version qualifier can be included in a command to dictate
807816
which version of Python will be used by the command. A version qualifier
808817
starts with a major version number and can optionally be followed by a period
809-
('.') and a minor version specifier. If the minor qualifier is specified, it
810-
may optionally be followed by "-32" to indicate the 32-bit implementation of
811-
that version be used.
818+
('.') and a minor version specifier. Furthermore it is possible to specifiy
819+
if a 32 or 64 bit implementation shall be requested by adding "-32" or "-64".
812820

813821
For example, a shebang line of ``#!python`` has no version qualifier, while
814822
``#!python3`` has a version qualifier which specifies only a major version.
815823

816-
If no version qualifiers are found in a command, the environment variable
817-
``PY_PYTHON`` can be set to specify the default version qualifier - the default
818-
value is "2". Note this value could specify just a major version (e.g. "2") or
819-
a major.minor qualifier (e.g. "2.6"), or even major.minor-32.
824+
If no version qualifiers are found in a command, the environment
825+
variable :envvar:`PY_PYTHON` can be set to specify the default version
826+
qualifier. If it is not set, the default is "3". The variable can
827+
specify any value that may be passed on the command line, such as "3",
828+
"3.7", "3.7-32" or "3.7-64". (Note that the "-64" option is only
829+
available with the launcher included with Python 3.7 or newer.)
820830

821831
If no minor version qualifiers are found, the environment variable
822832
``PY_PYTHON{major}`` (where ``{major}`` is the current major version qualifier
@@ -834,8 +844,8 @@ of the specified version if available. This is so the behavior of the launcher
834844
can be predicted knowing only what versions are installed on the PC and
835845
without regard to the order in which they were installed (i.e., without knowing
836846
whether a 32 or 64-bit version of Python and corresponding launcher was
837-
installed last). As noted above, an optional "-32" suffix can be used on a
838-
version specifier to change this behaviour.
847+
installed last). As noted above, an optional "-32" or "-64" suffix can be
848+
used on a version specifier to change this behaviour.
839849

840850
Examples:
841851

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ Ludwig Hähne
723723
Gerhard Häring
724724
Fredrik Håård
725725
Florian Höch
726+
Robert Hölzl
726727
Catalin Iacob
727728
Mihai Ibanescu
728729
Ali Ikinci

0 commit comments

Comments
 (0)