Python bytecode and .pyc file format specification

百般思念 提交于 2019-12-05 05:36:55

问题


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.


回答1:


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).




回答2:


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.



来源:https://stackoverflow.com/questions/35229387/python-bytecode-and-pyc-file-format-specification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!