[Tutor] Importing multiple files as a single module?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Fri Jan 21 19:54:38 CET 2005



On Fri, 21 Jan 2005, Kent Johnson wrote:

> I think this will work:
> in foo/__init__.py put
> from Bar import Bar
> from Baz import Baz
>
> or whatever variations of this you like.
>
> Any names defined in the package __init__.py are available to other code
> as package attribute.


Hi Max,

For more information on packages, we can take a look at:

    http://www.python.org/doc/tut/node8.html#SECTION008400000000000000000


Best of wishes!



More information about the Tutor mailing list