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 that source files can be run directly without explicitly creating an executable which is then run.

Leave a Comment