Python 开发的文件夹和文件组织
在 Python 开发环境中组织属于同一项目的代码的最佳方式是什么? Python 项目组织的注意事项是什么?您是否将每个类分开放在一个文件中?
Project A
Classes
"subsystem1"
class1
class2
subsystem1Module
"subsystem2"
"utils"
"etc"
Tests
Whatever
etc?
有什么建议吗?哦,请描述每种类型的组织(可能的)问题是什么。
组织 Python 代码的最佳实践是什么?
What is the best way to organize code that belongs to the same project in a Python development environment? What are the do and donts of Python project organization? Do you separate each class in a file?
Project A
Classes
"subsystem1"
class1
class2
subsystem1Module
"subsystem2"
"utils"
"etc"
Tests
Whatever
etc?
Any suggestions? Oh, and please describe what are the (possible) problems of each type of organization.
What are considered best practices for organizing Python code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一些建议位于 http://jcalderone.livejournal.com/39794.html 和 http://infinitemonkeycorps.net/docs/pph/
Some suggestions are at http://jcalderone.livejournal.com/39794.html and http://infinitemonkeycorps.net/docs/pph/
没有那么多问题只适用于 Python。此网站:软件配置管理模式 和副书描述了一些源代码管理模式。
这些问题是用熟悉的模式语言描述的,因此您应该能够找到满足您的要求所需的信息。与所有模式一样,也存在关于权衡的讨论。
There are not that many issues that are going to be applicable only to Python. This website: Software Configuration Management Patterns and the associate book describes some Source Code Management patterns.
The issues are described in the familiar patterns language so you should be able to find the information you need for your requirements. As with all patterns there is also discussion on the trade-offs.