官术网_书友最值得收藏!

How it works...

When source code (.py) is read by the Python interpreter, the bytecode is generated and stored in __pycache__ as <module_name>.<version>.pyc. The .pyc extension indicates that it is compiled Python code. This naming convention is what allows different versions of Python code to exist simultaneously on the system.

When source code is modified, Python will automatically check the date with the compiled version in cache and, if it's out of date, will automatically recompile the bytecode. However, a module that is loaded directly from the command line will not be stored in __pycache__ and is recompiled every time. In addition, if there is no source module, the cache can't be checked, that is, a bytecode-only package won't have a cache associated with it.

主站蜘蛛池模板: 长武县| 乡宁县| 白银市| 忻城县| 延津县| 潜江市| 洞口县| 台南县| 谢通门县| 威宁| 兴化市| 股票| 林周县| 营山县| 绥化市| 石嘴山市| 新安县| 丹东市| 吴旗县| 禄丰县| 兴化市| 通江县| 格尔木市| 招远市| 项城市| 麻阳| 鄂尔多斯市| 惠州市| 东丽区| 萝北县| 常州市| 泸溪县| 从江县| 吕梁市| 西安市| 鄂托克前旗| 信丰县| 遂宁市| 洛扎县| 刚察县| 定结县|