views:

5017

answers:

6
+4  Q: 

pyc to py files

hello, I wrote a lot of important python code for my project. unfortunately, I ran sed with wrong options and lost my files :( In repo these files are very old, but I have the pyc files.

How can I convert pyc files to py?

Thanks!

+6  A: 

http://www.crazy-compilers.com/decompyle/

There is still the package on Debian and friends (called decompyle) of the standalone software (ie, no need to send your pyc files), but it probably won't decompile 2.6 (or earlier).

Vinko Vrsalovic
+3  A: 

A quick search found a tool at http://byteplay.googlecode.com/svn/trunk/byteplay.py . http://wiki.python.org/moin/ByteplayDoc has docs.

I also saw http://www.depython.net/ and it looks really easy to use.

Brian
+8  A: 

http://stackoverflow.com/questions/48211/free-python-decompiler-that-is-not-an-online-service

Can Berk Güder
Someone should probably close this question as a duplicate.
Brian
+10  A: 

I know this doesn't answer your question direcly, but

For the love of the Flying Spaghetti Monster, start using version control!

Seriously, don't ever ever ever let this happen again. You should be using source control and some form of regular backups on every last line of code that you write.

There are a thousand good VCS's out there, hell just search stackoverflow for options. Bazaar is a good example of one that is easy-as-pie to use. Back it up to a portable hard drive, another PC, or use Dropbox for automatic backups.

Ryan
yes, i'm using version control system, but last time, i'm hardly working on code anf forgot commit my changes ;(
Golovko
downvoting because this doesn't address the question at all
Corey Goldberg
@corey: yes but he is right, +1
Stefano Borini
A: 

Use a VCS, and use it wisely. Which means "commit early, commit often". You get backups as free bonus.

A: 

you can use depython.com online service. http://depython.com is a new alternative online decompiling tool for Python pyc files. It does not have file size limit.

faraklit