Problem with modules refering to each other

Phil Hunt philh at
Sun Aug 8 03:28:30 CEST 1999

I have two python modules, both of which need to refer to classes 
defined in the other one. How do I do this? 

I am currently putting at the start of each module a line of the form:

   from theOtherModule import *

However, this is not working. My modules -- greatly simplified -- look
like this:
   from hhh import *
   ti = AnHhhClass()
   print ti

   from bak import *
   class AnHhhClass: pass

When I run ``python'', I get the error message 
``NameError: AnHhhClass''.

Phil Hunt....philh at

More information about the Python-list mailing list