Skip to content

python

python documentation

toolroom._stubs.python.Python

Bases: Tool[_R]

__call__

__call__(
    *args: str | PathLike[str],
    B: Flag = ...,
    E: Flag = ...,
    I: Flag = ...,
    O: Flag = ...,
    OO: Flag = ...,
    P: Flag = ...,
    S: Flag = ...,
    V: Flag = ...,
    W: Value = ...,
    X: Value = ...,
    b: Flag = ...,
    c: Value = ...,
    check_hash_based_pycs: Value = ...,
    d: Flag = ...,
    h: Flag = ...,
    help_all: Flag = ...,
    help_env: Flag = ...,
    help_xoptions: Value = ...,
    i: Flag = ...,
    m: Value = ...,
    q: Flag = ...,
    s: Flag = ...,
    u: Flag = ...,
    v: Flag = ...,
    x: Flag = ...,
    **flags: Any,
) -> _R

Run this verb.

Parameters:

Name Type Description Default
B Flag

don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x.

...
E Flag

ignore PYTHON* environment variables (such as PYTHONPATH).

...
I Flag

isolate Python from the user's environment (implies -E, -P and -s).

...
O Flag

remove assert and debug-dependent statements; add .opt-1 before .pyc extension; also PYTHONOPTIMIZE=x.

...
OO Flag

do -O changes and also discard docstrings; add .opt-2 before .pyc extension.

...
P Flag

don't prepend a potentially unsafe path to sys.path; also PYTHONSAFEPATH.

...
S Flag

don't imply 'import site' on initialization.

...
V Flag

print the Python version number and exit (also --version) when given twice, print more information about the build.

...
W Value

warning control; arg is action:message:category:module:lineno also PYTHONWARNINGS=arg.

...
X Value

set implementation-specific option.

...
b Flag

issue warnings about converting bytes/bytearray to str and comparing bytes/bytearray with str or bytes with int.

...
c Value

program passed in as string (terminates option list).

...
check_hash_based_pycs Value

control how Python invalidates hash-based .pyc files.

...
d Flag

turn on parser debugging output (for experts only, only works on debug builds); also PYTHONDEBUG=x.

...
h Flag

print this help message and exit (also -? or --help).

...
i Flag

inspect interactively after running script; forces a prompt even if stdin does not appear to be a terminal; also PYTHONINSPECT=x.

...
m Value

run library module as a script (terminates option list).

...
q Flag

don't print version and copyright messages on interactive startup.

...
s Flag

don't add user site directory to sys.path; also PYTHONNOUSERSITE=x.

...
u Flag

force the stdout and stderr streams to be unbuffered; this option has no effect on stdin; also PYTHONUNBUFFERED=x.

...
v Flag

verbose (trace import statements); also PYTHONVERBOSE=x can be supplied multiple times to increase verbosity.

...
x Flag

skip first line of source, allowing use of non-Unix forms of #!cmd.

...