
Victor C. answered 03/21/19
Python Programmer and Expert Spanish Tutor
Hi,
I understand your confusion, and that's because even though Python is an interpreted language, it does have a "bytcode compiler" included. Those ".pyc" files you mentioned contain bytecode.
In a compiled language (such as C) you need to compile the program first, this will output another intermediate file, a machine code file (in Windows: executable file). And then afterwards, you need to run that executable file.
In Python, you just run your program and you see the output, everything in one go, you don't need to do anything else.
However, behind the scenes Python itself is actually compiling the program into "bytecode" and then interprets it with its own PVM (Python Virtual Machine).
But why does it do that? The answer is Speed. It's a lot faster (simpler) to interpret from bytecode than trying to interpret a high level language directly. By using an "easily interpreted structure", then at execution the interpreter can focus on performing actions only.
So Python is an interpreted language that does some compiling under the hood to achieve better performance. I hope this helps. Just let me know if you have any other questions.