How to simulate packages?

Daniel daniel.watrous at gmail.com
Thu Aug 21 23:06:11 CEST 2008


On Aug 21, 12:26 pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
wrote:
> En Thu, 21 Aug 2008 13:04:51 -0300, Daniel <daniel.watr... at gmail.com>  
> escribi :
>
> > I have a project that I've decided to split into packages in order to
> > organize my code better.  So what I have looks something like this
>
> > src
> >   -module1
> >     -mod1_file.py
> >   -module2
> >     -mod2_file.py
>
> > Everytime I run mod2_file.py I need to import mod1_file.py.  Right now
> > I'm using an ugly little thing to do my import (see below).  Isn't
> > there some python mechanism to handle packages?
>
> Sure - Python *has* packages, you don't have to "simulate" them.
> Readhttp://docs.python.org/tut/node8.html#SECTION008400000000000000000
>
> --
> Gabriel Genellina

Thanks for the link.  That's exactly what I was looking for.  Not sure
why I didn't find it on Google.

Much appreciated.

Daniel



More information about the Python-list mailing list