I'd like to get the bytecode of a module in Python and save it in a pyc with marshal.
Example:
abc
- test
- module
- t2
- mod2
Then I import abc.test.module and would like to get the bytecode and thus save a pyc from it, from that.
I'd like to get the bytecode of a module in Python and save it in a pyc with marshal.
Example:
abc
Then I import abc.test.module and would like to get the bytecode and thus save a pyc from it, from that.
A good but discontinued tool is UnPyc (it supports versions 2.5 and 2.6 of Python). There are reports that this decompiler can recover about 90% from the original file.
There's also Easy Python Decompiler which is based on two decompilers (uncompyle2 and decompyle ++ ). The interesting thing is that it supports from 1.0 to 3.3 of Python.
Also note the py_compile
module.