python: how to get the source from a code object? [duplicate]
This question already has an answer here: Exploring and decompiling python bytecode [closed] 6 answers let's suppose we have a python string(not a file,a string,no files) TheString = "k=abs(x)+y" ok? Now we compile the string into a piece of python bytecode Binary = compile( TheString , "<string>" , "exec" ) now the problem: how can i get from Binary , supposing i don't know TheString , a string that represents the original string object? shortly: what is the function that is opposite to compile() ? Without the source code, you can only approximate the code. You can disassemble the compiled