From Source to Bytecode: How .py Becomes .pyc
摘要
Although Python is often classified as an interpreted language, Python code is actually compiled to bytecode before execution, as we’ve mentioned several times in previous chapters. The .pyc file is the file generated from this compilation process, and its main purpose is to boost program execution speed. In this chapter, we’ll take a closer look at how these .pyc files are generated and what interesting things they contain.