Python

Documentation

Reference

Guides

Python Enhancement Proposals

PEP

Title

See Also

248

Python Database API Specification v1.0

249

Python Database API Specification v2.0

302

New Import Hooks

333

Python Web Server Gateway Interface v1.0

Optional Platform-Specific File Handling

428

The pathlib module – object-oriented filesystem paths

440

Version Identification and Dependency Specification

441

Improving Python ZIP Application Support

443

Single-dispatch generic functions

465

A dedicated infix operator for matrix multiplication

492

Coroutines with async and await syntax

518

Specifying Minimum Build System Requirements for Python Projects

567

Context Variables

3000

Python 3000

Runtime

Environment Variable

Option

Notes

PYTHONPATH

PYTHONDONTWRITEBYTECODE

-B

PYTHONSAFEPATH

-P

PYTHONWARNINGS

-W

Bugtracker: -W option cannot use non-standard categories

PYTHONIOENCODING

StackOverflow: UnicodeDecodeError when redirecting to file

When you redirect the output of your program, it is generally not possible to know what the input encoding of the receiving program is. The interpreter falls back to some default encoding for stdin, stdout, and stderr (None for Python 2, UTF-8 for Python 3).

$ python -c "import sys; print sys.stdout.encoding"
UTF-8
$ python -c "import sys; print sys.stdout.encoding" | cat
None

Set PYTHONIOENCODING to override the default encoding for stdin, stdout, and stderr.

$ PYTHONIOENCODING=UTF-8 python -c "import sys; print sys.stdout.encoding" | cat
  UTF-8

Community

General

Language

Packaging

Python 3

Asynchronous I/O

Scientific Computing

Infrastructure

Docker

Modules

Standard Library

Third Party