Is it possible to decompile a compiled .pyc file into a .py file?

Uncompyle6 works for Python 3.x and 2.7 – recommended option as it’s most recent tool, aiming to unify earlier forks and focusing on automated unit testing. The GitHub page has more details. if you use Python 3.7+, you could also try decompile3, a fork of Uncompyle6 focusing on 3.7 and higher. do raise GitHub issues on these projects if … Read more

If Python is interpreted, what are .pyc files?

They contain byte code, which is what the Python interpreter compiles the source to. This code is then executed by Python’s virtual machine. Python’s documentation explains the definition like this: Python is an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the bytecode compiler. This means … Read more