Newbie packages Q

Bruno Desthuilliers bruno.42.desthuilliers at
Sun Oct 7 18:04:38 CEST 2007

MarkyMarc a écrit :
> It was simply to make a point. But then lets say the to files looks
> like this:
>  *******************************
> def printA():
>         print "This is Atest from Apack"
> *******************************
> from Test.apack import atest

FWIW, better to stick to all_lower names for packages and modules.

> def printB():
>         print "This is Btest from Bpack"
> def printatest():
>         print atest.printA()
> print printB()
> print printatest()
> *******************************
> Now only one of them imports the other, and this most be the simplest
> way of illustrating the intra-package references.
> But how do I get this to work?

You failed to specify how your files are organized, and what is "not 

But anyway, if
- is in <wherever>/Test/apack,
- both Test and apack have a
- <wherever> is in the sys.path,

then this should just work AFAICT.

More information about the Python-list mailing list