If Python is interpreted, what are .pyc files?

前端 未结 11 957
夕颜
夕颜 2020-11-22 08:39

I\'ve been given to understand that Python is an interpreted language...
However, when I look at my Python source code I see .pyc files, w

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 09:18

    Python code goes through 2 stages. First step compiles the code into .pyc files which is actually a bytecode. Then this .pyc file(bytecode) is interpreted using CPython interpreter. Please refer to this link. Here process of code compilation and execution is explained in easy terms.

提交回复
热议问题