.pyc > .py ?
b_mcerlean at yahoo.com
Sun Aug 4 00:43:08 CEST 2002
Matthias Huening <mhuening at zedat.fu-berlin.de> wrote in message news:<Xns925F5CCBF3021mhueningzedatfuberli at 184.108.40.206>...
> Hhmm, I'm afraid my editor ate up one of my modules... I don't
> know how, but the file is gone...
> I still have a compiled .pyc-version. So here is my question:
> is it possible to get back the source file from the .pyc file?
> Thanks, Matthias
Take a look at decompyle (http://www.goebel-consult.de/decompyle/)
To restore a missing myfile.py from the myfile.pyc bytecode you can
>>>outputfile = open('myfile.py','w')
This should restore the code nearly identical to the source, though
you will lose any comments and the exact layout of your code, since
these won't be preserved in the .pyc file.
More information about the Python-list