Py

From Omnia
Revision as of 18:26, 1 July 2024 by Kenneth (talk | contribs) (→‎Python Launcher)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

py - Python Windows Launcher

Windows Launcher

https://docs.python.org/3/using/windows.html#python-launcher-for-windows

Python Launcher

General usage:

py
py -2
py -3
py -3.10
py --list        # list available options
py -0            # short list available options
py --list-paths  # list available options with paths
py -0p           # short list available options with paths
Python Launcher for Windows Version 3.10.6150.1013

usage:
py [launcher-args] [python-args] [script [script-args]]

Launcher arguments:

-2     : Launch the latest Python 2.x version
-3     : Launch the latest Python 3.x version
-X.Y   : Launch the specified Python version
     The above all default to 64 bit if a matching 64 bit python is present.
-X.Y-32: Launch the specified 32bit Python version
-X-32  : Launch the latest 32bit Python X version
-X.Y-64: Launch the specified 64bit Python version
-X-64  : Launch the latest 64bit Python X version
-0  --list       : List the available pythons
-0p --list-paths : List with paths

 If no script is specified the specified interpreter is opened.
If an exact version is not given, using the latest version can be overridden by
any of the following, (in priority order):
 An active virtual environment
 A shebang line in the script (if present)
 With -2 or -3 flag a matching PY_PYTHON2 or PY_PYTHON3 Environment variable
 A PY_PYTHON Environment variable
 From [defaults] in py.ini in your %LOCALAPPDATA%\py.ini
 From [defaults] in py.ini beside py.exe (use `where py` to locate)

...

Shebang

Shebang [1]

/usr/bin/env python
/usr/bin/python
/usr/local/bin/python
python
#! /usr/bin/python -v

Python

See Python

Windows Python

See Windows/Python

keywords