<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hello all, | | I'm starting work on what is going to become a fairly substantial | Python project, and I'm trying to find the best way to organize | everything. The project will consist of: | | - A few applications | - Several small scripts and utilities | - Unit tests and small interactive test programs | - A number of custom libraries and modules that may be shared and | referenced among all of the above | | I have the following general structure in mind: | | myproject/ | app1/ | main.py
If you put myproject in Pythonxy/Lib/site-packages, there is no need to fiddle with PYTHONPATH or sys.path. In 3.0a5 I tried a relative import and got a message that relative imports only work within packages, not modules. I presume that means package.__init__.py. Maybe I just miswrote the import, but I decided to stick with what dependably works whether from within or without the package from package.subpackage import module #or from package.subpackage.module import object. I agree with the comment about removing the 'shared' package layer. Two packages deep is enough typing unless the deeper hierarchy is needed (like possibly the 'tests' subsubpackages, if they make running the tests easier). tjr -- http://mail.python.org/mailman/listinfo/python-list