[python-uk] Python project layout?

Alec Muffett alec.muffett at gmail.com
Fri May 8 13:32:04 CEST 2009


Hi folks,

I'm a old fart^H^H^H^H Perl hacker converting to Python, and am  
starting out on my first Python project.  I'm currently inhaling "Dive  
into Python" and the "Python Cookbook", and am lining up the Django  
book as my next read.  So far I've read heaps of syntax and code, and  
written a few test scripts.

Beyond some information on how "import" works, what I am not finding  
is anything about typical project layout - ie: the names of files and  
subdirectories laid out for class inheritance, loading etc; For  
instance, in http://bitbucket.org/jespern/django-piston/src/tip/examples/blogserver/ 
  there are actualy *files* called "__init__.py" and so forth.  I  
suspect that's a Django thing rather than python syntax, but am not  
sure.

So far I am putting all my classes and all their methods into a single  
file, which I am sure it not tenable.  I suspect I should really  
create a project directory "foo" and edit "foo/bar.py" and "foo/ 
baz.py" so that I can "import foo.bar" -- but is there any other magic  
I need to do? (cf: package templates in perl)

Is there anything on the web I can look at to find out about this stuff?

thanks in advance,

	- alec




More information about the python-uk mailing list