Python的setup.py其实是python工具包distutils的配置文件,setuptools就是基于distutils来做的。
在setup.py中通过setup函数来配置打包信息。
首先要引入setuptools的函数setup。
setuptools的setup其实就是distutils的setup函数
#coding=utf8 from setuptools import setup, find_packages setup( name = "py-example-example", version = "0.1", packages = find_packages(), description = "python egg example", long_description = "python egg example", author = "darion", author_email = "[email protected]", license = "GPL", keywords = ("python", "egg"), platforms = "Independant", url = "http://darion.yaphet.github.io", )
运行上面的命令生成Python egg文件
python setup.py bdist_egg
其实 egg 文件就是zip文件
file Scrapy-0.23.0-py2.7.egg Scrapy-0.23.0-py2.7.egg: Zip archive data, at least v2.0 to extract
压缩文件主要是项目描述文件 .py文件和.pyc文件
更多具体内容 自己解压文件看吧
参考文献:
http://www.cnblogs.com/itech/archive/2011/02/13/1953268.html