博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
The Quick Guide to Python Eggs
阅读量:6630 次
发布时间:2019-06-25

本文共 2648 字,大约阅读时间需要 8 分钟。

The Quick Guide to Python Eggs

NOTE: If all you want to do is install a project distributed as an .egg file, head straight to the . EasyInstall makes installing Python code as easy as typing easy_install SomeProjectName. You don't need to read this page unless you want to know more about how eggs themselves work.

Table of Contents

"Eggs are to Pythons as Jars are to Java..."

Python eggs are a way of bundling additional information with a Python project, that allows the project's dependencies to be checked and satisfied at runtime, as well as allowing projects to provide plugins for other

projects. There are several binary formats that embody eggs, but the most common is '.egg' zipfile
format, because it's a convenient one for distributing projects. All of the formats support including package-specific data, project-wide metadata, C extensions, and Python code.

The easiest way to install and use Python eggs is to use the Python package manager, which will find, download, build, and install eggs for you; all you do is tell it the name (and optionally, version) of the Python project(s) you want to use.

Python eggs can be used with Python 2.3 and up, and can be built using the package (see the for source code, or the for current installation instructions).

The primary benefits of Python Eggs are:

  • They enable tools like the Python package manager

  • .egg files are a "zero installation" format for a Python package; no build or install step is required, just put them on PYTHONPATH or sys.path and use them (may require the runtime installed if C extensions or data files are used)

  • They can include package metadata, such as the other eggs they depend on

  • They allow "namespace packages" (packages that just contain other packages) to be split into separate distributions (e.g. zope.*, twisted.*, peak.* packages can be distributed as separate eggs, unlike normal packages which must always be placed under the same parent directory. This allows what are now huge monolithic packages to be distributed as separate components.)

  • They allow applications or libraries to specify the needed version of a library, so that you can e.g. require("Twisted-Internet>=2.0") before doing an import twisted.internet.

  • They're a great format for distributing extensions or plugins to extensible applications and frameworks (such as , which uses eggs for plugins as of 0.9b1), because the egg runtime provides simple APIs to locate eggs and find their advertised entry points (similar to Eclipse's "extension point" concept).

There are also other benefits that may come from having a standardized format, similar to the benefits of Java's "jar" format.

转载地址:http://ugwvo.baihongyu.com/

你可能感兴趣的文章
DOS窗口TELNET登陆终端批量执行命令
查看>>
Linux 线程实现机制分析
查看>>
转:Android世界的15款开源的游戏开发引擎
查看>>
多线程访问同一个可变变量,需增加同步机制
查看>>
apdplat 多表查询属性设置
查看>>
Code::Blocks设定相关
查看>>
PL/SQL基础篇10(trigger)
查看>>
Spring Security权限框架理论与简单Case
查看>>
Invalid icc profile: duplicate sequence numbers
查看>>
day1
查看>>
开源中国的 IT 公司开源软件整理计划介绍
查看>>
DDoS deflate - Linux下防御/减轻DDOS***
查看>>
关于outlook2007在WIN7下收取邮件很慢的解决办法
查看>>
Android第三十七天
查看>>
VMM2012应用指南之13- 自助服务门户网站的使用
查看>>
GraphQL入门
查看>>
IBM Java多线程 - 1. 线程基础
查看>>
3月7日高项作业(信息化基础和信息系统服务管理)
查看>>
【C++探索之旅】第一部分第六课:控制流程,随心所至
查看>>
我的友情链接
查看>>