Packages, modules, libraries,...

Mikael Olofsson mikael at isy.liu.se
Tue Feb 1 09:12:34 EST 2000


On 01-Feb-00 Adrian Eyre wrote:
 >  Imagine the following filesystem structure:
 >  
 >  /home/fred/python/  <- This is in the PYTHONPATH
 >                   |
 >                   +- cafe/
 >                   |      |
 >                   |      +- __init__.py
 >                   |      |
 >                   |      +- bacon.py
 >                   |
 >                   +- spam.py
 >  
 >  
 >  import spam             # Imports "module" from file spam.py[c]
 >  import cafe             # Imports "package" from file cafe/__init__.py[c]
 >  import cafe.bacon       # Imports "module" from file cafe/bacon.py[c]

Just to be sure: I guess I have to import cafe before I can import 
cafe.bacon. Are there any special demands on cafe/__init__.py compared
to ordinary modules?

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    01-Feb-00
Time:    15:09:48

This message was sent by XF-Mail.
-----------------------------------------------------------------------




More information about the Python-list mailing list