Entry
How can I decompile a python PYC file to see the source?
Aug 26th, 2007 00:58
shi woo, unknown unknown, Thomas Wouters, Erno Kuusela
You cannot. .pyc files are bytecode, and you can only disassemble them
into a representation of bytecode. That's not as low-level as
machine-code, but it's not Python code either ! See the 'dis' module on
how to disassemble.
------------
try decompyle
(<URL:http://www.csr.uvic.ca/~aycock/python/content.html#decompyle>).
try depython
(<URL:http://www.depython.net).You can online test its function freely .
note the words of warning on the page:
| It's rather fragile, and dependent on what the Python bytecode
| compiler emits. I'm releasing it for demonstration and amusement
| purposes only.