How to organize Python files in a (relatively) big project
david at jotax.com
Wed Oct 19 10:46:10 CEST 2005
I have this problem myself, and as I am a recent Python convert my
aproach may not be conventional - but as it is working for me I thought
I would share.
First off you need to split your code into logical objects. In my case
I have an obvious client and server object, But within each I have
individual stand alone major objects and so my directory structure
Server Object 1
Server Object 2
Each main.py file is used to call each downstream main.py file be it as
a thread or once only run. The beauty of this idea is that if I want
to completely change say Server Object 2, I can do whatever I like
within the downstream directory as the only outside call is via an
external reference to the main.py file.
If you have a mind, you could have a library file of common apps held
within the bin directory that you can make available to all downstream
As I say - it only works if you can logically split your program into
If there is a more Pythonesque way of doing this I be grateful if
someone could share.
More information about the Python-list