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

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.

主站蜘蛛池模板: 本溪| 开化县| 贡觉县| 长寿区| 新平| 锦州市| 内乡县| 高要市| 县级市| 杨浦区| 桓台县| 永修县| 长丰县| 安福县| 汝阳县| 济宁市| 科尔| 宁夏| 新巴尔虎右旗| 冕宁县| 宣汉县| 浠水县| 巴彦县| 奇台县| 师宗县| 祁阳县| 蛟河市| 台南市| 文山县| 扬中市| 兴业县| 工布江达县| 惠来县| 南城县| 四会市| 当雄县| 天长市| 达孜县| 阳泉市| 项城市| 乐业县|