"Henry Dominik" <[EMAIL PROTECTED]> wrote

> Besides, why did I have to do this: class 
> EmplAddrBookEntry(AddrBookEntry.AddrBookEntry):
> 
> The AddrBookEntry and EmplAddrBookEntry classes 
> are in the same folder, 

Python doesn't care abpout the foldrs it only cares about 
the modules. They are in different modules therefore you 
need to import the other module. But importing the module 
just makes the module name available inside your module.
To make the contents of the module available you must 
reference the module. Modules are first class objects in 
Python they are not simply files (although they are 
implemented as simple files!)  You might think of the 
module as being like a class that you can't instantiate 
if you like.

Alternarively you can use the other form of import:

from Module import Name

In your cae that would be

from AddrBookEntry import AddrBookEntry

Now when you use AddrBookentry it refers to the named object  
inside the AddrBookEntry module.

HTH,

Alan G.

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to