gpt4 book ai didi

python - 什么是 Python 蛋?

转载 作者:IT老高 更新时间:2023-10-28 12:02:16 26 4
gpt4 key购买 nike

我是 Python 新手,我只是想了解它的包是如何工作的。大概 eggs 是某种包装机制,但什么是它们所扮演角色的快速概述,可能是关于它们为什么有用以及如何创建它们的一些信息?

最佳答案

Note: Egg packaging has been superseded by Wheel packaging.

与Java中的.jar文件的概念相同,它是一个.zip文件,其中一些元数据文件重命名为.egg,用于分发代码作为包。

Specifically: The Internal Structure of Python Eggs

A "Python egg" is a logical structure embodying the release of a specific version of a Python project, comprising its code, resources, and metadata. There are multiple formats that can be used to physically encode a Python egg, and others can be developed. However, a key principle of Python eggs is that they should be discoverable and importable. That is, it should be possible for a Python application to easily and efficiently find out what eggs are present on a system, and to ensure that the desired eggs' contents are importable.

The .egg format is well-suited to distribution and the easy uninstallation or upgrades of code, since the project is essentially self-contained within a single directory or file, unmingled with any other projects' code or resources. It also makes it possible to have multiple versions of a project simultaneously installed, such that individual programs can select the versions they wish to use.

关于python - 什么是 Python 蛋?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2051192/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com