If you have some Python modules or packages that you would like to
share with the Python community, we'd love to have them included in
the Python Package Index! First, if you haven't done so, you will want
to get your project organized. You might follow the guidelines at
ProjectFileAndDirectoryLayout. After that, you'll want to read the
Python documentation regarding creating distributions:
http://docs.python.org/distutils/index.html.
Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.
Since module names are mapped to file names, and some file systems are case insensitive and truncate long names, it is important that module names be chosen to be fairly short -- this won't be a problem on Unix, but it may be a problem when the code is transported to older Mac or Windows versions, or DOS.
也许{a1}对你有帮助。从那里开始:
您还可以查看Tarek的《Python编程专家》(expertpython Programming)中的Writing a Package in Python by Tarek Ziadé,其中详细介绍了有关开发和分发的问题
举个例子总是最好的办法:
http://packages.python.org/an_example_pypi_project/
我建议阅读The Hitchhiker's Guide to Packaging。具体来说,您应该看看Quick Start section,它描述了如何:
您还应该查看Introduction to Packaging section中的Current State of Packaging,因为这有助于解开围绕setuptools、distutils、distutils2和distribute的一些混乱。在
更新主题:如何命名文件
下面的摘录来自PEP8,它回答了您关于如何命名文件的问题:
相关问题 更多 >
编程相关推荐