简体   繁体   中英

How to recover a .py file from PyInstaller .exe?

I lost my original python code that I've been working on for months, it's packed into an .exe using PyInstaller and that's all I have.

I tried this: Exe to python with pyinstaller?

I was able to extract a file that has some of my source code in it but it's filled with all this gibberish:

Graphing...

z Value="é z0" MÚ0c C sg | ]}| dd¡qS )ú"Ú )Ú replace)Ú.0Ús© r úGraphLEDView_1.1.pyú ( src C sg | ]}t dd|¡qS )z[^0-9]r )ÚreÚsub)r Ú LedDatar rr
r ) s )Údtype)é g @)Ú figsizei¸ é z Sensor {}g ü?)ÚlabelÚ linewidthÚLEDsÚ BrightnessÚlogz

What was extracted was a file with the name of my code without the .py extension and a folder of .pyc files none of which are my code, just the dependent libraries. Can someone help me get my code back? A lot of work down the drain if I can't get it back... I feel really dumb. Thanks

Adam, you got a error [TypeError: extractFiles() takes 1 positional argument but 2 were given] , i think you haven't put "pyinstxtractor.py" in the same folder, module missed.

if you want to know more, you can open the python_exe_unpack.py , see which line have error, find the reason.

It doesn't seem to be possible. Pyinstaller converts the .py file into binary which your computer can understand. From what I can see, there isn't a way to convert the .exe to a .py file again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM