由于不小心删除了py文件,在网上找到下面工具可以反向编译生成py.
Installation instructions:
git clone https://github.com/gstarnberger/uncompyle.git
cd uncompyle/
sudo ./setup.py install
Once the program is installed (note: it will be installed to your system-wide-accessible Python packages, so it should be in your $PATH), you can recover your Python files like so:
uncompyler.py thank_goodness_this_still_exists.pyc > recovered_file.py
The decompiler adds some noise mostly in the form of comments, however I've found it to be surprisingly clean and faithful to my original code. You will have to remove a little line of text beginning with +++ near the end of the recovered file to be able to run your code
当误删py文件时,可以使用Uncompyle工具进行反编译恢复。安装后,通过简单命令即可将pyc文件转换回py。虽然会添加一些注释噪音,但代码通常能保持原始状态,只需移除文件末尾的特定行即可运行。
1559

被折叠的 条评论
为什么被折叠?



