将目录命名为与您的项目相关的名称。当你发布版本时,你应该包含一个版本号后缀:Twisted-2.5。
不知道为什么这不清楚。这似乎很明显。这一切都必须在一个目录中。
为什么东西必须在一个目录中?因为每个人都这么说,所以这就是原因。
创建一个目录 Twisted/bin 并将您的可执行文件放在那里。
这就是 Linux 的工作方式。可执行文件位于bin
目录中。它可以很容易地将此特定目录放入您的PATH
环境变量中。
如果您的项目可以表示为单个 Python 源文件,则将其放入目录中,并将其命名为与您的项目相关的名称。例如,Twisted/twisted.py。
对。您有 /Twisted、/Twisted/bin 和 /Twisted/twisted.py 以及其中的实际运行代码。你还会把它放在哪里?
这没有“为什么”。你还能把它放在哪里?
如果您需要多个源文件,请改为创建一个包(Twisted/twisted/,使用空的 Twisted/twisted/ init .py)并将源文件放入其中。例如,Twisted/twisted/internet.py。
This is just the way Python packages work. They're directories with __init__.py
files. The tutorial is pretty clear on this.
put your unit tests in a sub-package of your package Twisted/twisted/test/.
Where else would you put your tests? Seriously. There's no "why?" to this. There's no sensible alternative.
add Twisted/README and Twisted/setup.py to explain and install your software, respectively
Right. Where else would you put them? Again. There's no "why?" They go in the top directory because -- well -- that's what a directory is for. It contains files.