Tin mới
codecs — Codec registry and base classes
This module converts between Python values and C structs represented as Python bytes objects. Compact format strings describe the intended conversions to/from Python values. The module’s functions and objects can be used
This module converts between Python values and C structs represented as Python bytes objects. Compact format strings describe the intended conversions to/from Python values. The module’s functions and objects can be used
Byte Order, Size, and Alignment¶
By default, C types are represented in the machine’s native format and byte order, and properly aligned by skipping pad bytes if necessary (according to the rules used by the C compiler). This behavior is chosen so that
array: Space efficient arrays of uniformly typed numeric values.
The array and ctypes modules, as well as third-party modules like numpy, use similar – but slightly different – type codes.
Changed in version 3.1: Previously, some of the integer formats wrapped out-of-range values and raised DeprecationWarning instead of struct.error.
json: Encode and decode the JSON format.
pickle: Convert Python objects to streams of bytes and back.