什么是巨蟒蛋? [英] What is a Python egg?
问题描述
我是 Python 新手,我只是想了解它的包是如何工作的.据推测,eggs
是某种包装机制,但如何快速了解它们所扮演的角色,以及关于它们为何有用以及如何创建它们的一些信息?
I'm new to Python and I'm just trying to understand how its packages work. Presumably eggs
are some sort of packaging mechanism, but what would be a quick overview of what role they play and may be some information on why they're useful and how to create them?
推荐答案
与Java中.jar
文件的概念相同,它是一个.zip
文件,其中一些元数据文件重命名为.egg
,用于分发代码打包.
Same concept as a .jar
file in Java, it is a .zip
file with some metadata files renamed .egg
, for distributing code as bundles.
Python 蛋"是一个逻辑结构,体现了一个Python 项目的特定版本,包括其代码、资源、和元数据.有多种格式可用于对 Python 蛋进行物理编码,其他人可以开发.然而,Python 鸡蛋的一个关键原则是它们应该是可发现的并且可进口.也就是说,Python 应用程序应该可以轻松有效地找出系统上存在哪些鸡蛋,以及以确保所需鸡蛋的内容是可导入的.
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.
.egg
格式非常适合分发和简单的卸载或升级代码,因为项目本质上是自包含在单个目录或文件中,与任何其他项目的代码或资源.这也使得有可能同时安装一个项目的多个版本,例如个别程序可以选择他们想要使用的版本.
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.
这篇关于什么是巨蟒蛋?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!