Python - Compiled File (Cache)

> Procedural Languages > Python > Python - Engine

1 - About

The compiled file of Python.

Advertising

3 - Location

To speed up loading modules, Python caches the compiled version of each module in the __pycache__ directory

4 - Format

The name

module.version.pyc

where:

For example, in CPython release 3.3:

  • source: spam.py
  • compiled version: __pycache__/spam.cpython-33.pyc.

This naming convention allows compiled modules from different releases and different versions of Python to coexist.

5 - Documentation / Reference

Advertising