Binary and Encoding Modules

quopri

Encode and decode MIME quoted-printable content. The representation preserves many printable ASCII bytes while escaping others. This is a byte transform rather than encryption; encode Unicode text to bytes before processing it.

Formal Syntax & Structure

python syntaxpython
import quopri

Return Value

module

Module namespace available through import; import is a statement, not a value-returning expression.

Working Example

Example Snippetpython
import quopriraw = "café".encode("utf-8")encoded = quopri.encodestring(raw)print(encoded)print(quopri.decodestring(encoded).decode("utf-8"))
Python Reference