[Tutor] modular program
W W
srilyk at gmail.com
Sun Mar 1 14:05:37 CET 2009
On Sun, Mar 1, 2009 at 3:36 AM, Daniele <d.conca at gmail.com> wrote:
> Hi,
> I'd like to write a python program which can be easily extended by other
> people. Where can I find some "best practices" for writing modular programs?
> I thought about a txt file containing function calls that my program will
> parse and execute in order, or is it better just to execute every .py file
> in a certain "module" folder (I don't like this as modules could need to be
> executed in different moments)? Can any1 point me to a relatively simple
> program to look at?
Using classes is a pretty good idea. Then people can either "import
daniele" or "from daniele import niftyClass".
You can pretty much take a look at any of the modules in your python
library directory. In the case of my linux box, that's
/usr/lib/python2.5/
HTH,
Wayne
More information about the Tutor
mailing list