16

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?

George Silva
  • 3,266
  • 9
  • 34
  • 60
  • 2
    Duplicate: http://stackoverflow.com/questions/391879/organising-my-python-project – S.Lott Oct 29 '09 at 11:21
  • 2
    I'm not sure if it is a exact duplicate, i wanted mostly opinions. see community wiki. but thanks anyway. – George Silva Oct 29 '09 at 11:52
  • @George: "not sure" isn't really much of an argument, is it? If this is different, please provide specific reasons why it is different. Please update the question to reference the previous question and show how yours is completely different. Please update the question; do not add yet more comments to clarify your question. it's your question. Update it. – S.Lott Oct 29 '09 at 13:26
  • 2
    @S.Lott the post you brought explains some issues around my question, but i was asking for suggestions. How people organize their own code. Sure, your link solved some technical issues, but that was not the main point of the question. – George Silva Oct 29 '09 at 13:37

2 Answers2

9

Some suggestions are at http://jcalderone.livejournal.com/39794.html and http://infinitemonkeycorps.net/docs/pph/

mmmmmm
  • 30,723
  • 26
  • 85
  • 109
1

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.

Tendayi Mawushe
  • 24,137
  • 5
  • 45
  • 56