什么是 Python 蛋?

What is a Python egg?(什么是 Python 蛋?)
本文介绍了什么是 Python 蛋?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我是 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 Eggs的内部结构

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.

这篇关于什么是 Python 蛋?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How do I make a list of all members in a discord server using discord.py?(如何使用 discord.py 列出不和谐服务器中的所有成员?)
how to change discord.py bot activity(如何更改 discord.py 机器人活动)
Issues with getting VoiceChannel.members and Guild.members to return a full list(让 VoiceChannel.members 和 Guild.members 返回完整列表的问题)
Add button components to a message (discord.py)(将按钮组件添加到消息(discord.py))
on_message() and @bot.command issue(on_message() 和@bot.command 问题)
How to edit a message in discord.py(如何在 discord.py 中编辑消息)