Python 3.7+ .pyc file format


[:  :]

diagram of the pyc file format

Fun Fact: A Py3.7+ .pyc code object contains a header for various things like the number of local variables, stack size, flags etc, as well as the bytecode for the code block. All header values are big endian, except for the size of the bytecode, which is a 4 byte little endian field (at 0x64).

Original: https://twitter.com/netspooky/status/1338997963910225922

TODO: Get original ansi