multiple namespaces within a single module?

jkn jkn_gg at nicorp.f9.co.uk
Fri Feb 10 00:24:58 CET 2012


Hi Peter

On Feb 9, 7:33 pm, Peter Otten <__pete... at web.de> wrote:
> jkn wrote:
> >     is it possible to have multiple namespaces within a single python
> > module?
>
> Unless you are abusing classes I don't think so.
>
> > I have a small app which is in three or four .py files. For various
> > reasons I would like to (perhaps optionally) combine these into one
> > file.
>
> Rename your main script into __main__.py, put it into a zip file together
> with the other modules and run that.

Hmm ... thanks for mentioning this feature, I didn't know of it
before. Sounds great, except that I gather it needs Python >2.5? I'm
stuck with v2.4 at the moment unfortunately...

    J^n



More information about the Python-list mailing list