Search code examples
pythonbytecodepyc

Given a python .pyc file, is there a tool that let me view the bytecode?


A Python module is automatically compiled into a .pyc file by CPython interpreter. The .pyc file, which contains the bytecode, is in binary format (marshaled code?). Is there a GUI (or command line) tool that let me view the bytecode?


Solution

  • There's a visual python disassembler called PyChrisanthemum.

    To do it the command-line way you can use module dis (python 2.7.3, python 3.2.3), as OP already found out.