ID EN
Base64

encodebytes

Python 3.11

Encode the bytes-like object s, which can contain arbitrary binary data, and return bytes containing the base64-encoded data, with newlines (b'\n') inserted after every 76 bytes of output, and ensuring that there is a trailing newline, as per RFC 2045 (MIME).

Syntax

PYTHON
base64.encodebytes(s)

See Also

bytes-like object bytes