Python bytecode and .pyc file format specification

2019-04-13 02:14发布

I'm looking for pyc file format specification, I found this link that provides bytecode instructions without the opcodes but I need alot more detailed file that includes the file structure of the .pyc, Can anyone provide me a link to it?

Thanks.

2条回答
成全新的幸福
2楼-- · 2019-04-13 02:32

The structure of .pyc files is explained here: http://nedbatchelder.com/blog/200804/the_structure_of_pyc_files.html

Cilyan already posted a link to the actual documentation for the bytecodes in the standard library (https://docs.python.org/3.5/library/dis.html#python-bytecode-instructions).

查看更多
smile是对你的礼貌
3楼-- · 2019-04-13 02:41

Python bytecode is considered an implementation detail and not officially supported or documented. Your best bet is to look at the source code of the interpreter whose bytecode you are interested in.

查看更多
登录 后发表回答