escribió:
I'm about to develop a small python application and I wonder how toYou don't *have* to artificially restrict yourself to one class per file.
organize files in this application.
I'm familar to java, so I'm tempted to use the same convention : 1 file
per class and 1 folders per package.
In Python it's common to place several related classes in the same module
(i.e., file). You don't have to write so much boilerplate code as in Java,
so classes tend to be smaller in size; you may even find classes with an
empty body.
I know that packages doesn't exists in python, they are modules instead.Uh? Have you read the Python Tutorial?
http://docs.python.org/tut/node8.htm...00000000000000
So, what are best practices for organizing files and folders in a smallA small application may consist of just a main entry point and some
python project ?
I've found PEP8 (http://www.python.org/dev/peps/pep-0008/) that gives a
lot of good hints on coding convention, but nothing about files
organization.
imported modules, all residing in the same directory. It might not require
to define any package. Perhaps later, when some module grows too much, you
may want to refactor it, creating a package. But try to keep simple things
simple.
--
Gabriel Genellina