Recover Python script from memory, I screwed up

前端 未结 3 2278
谎友^
谎友^ 2020-12-18 11:52

Help, I screwed up.

I have a somewhat complex python script that is currently running in a putty window to a Ubuntu server.

I accidentally overwrote the scri

3条回答
  •  渐次进展
    2020-12-18 12:19

    I am two years too late for this question but this is how i recovered my script. After running the script, in the pycache folder, there will be .pyc (bytecode) file with the same name as the script. You can use a third party module called uncompyle to decompile this .pyc file to get back the source code. The only disadvantage is that your comments will get lost. But something is better than nothing.

提交回复
热议问题