Newbie: module structure and import question

Ziong ziongmail-py at
Wed Jan 12 10:06:43 EST 2005

hi all,
i have question on how to design a module structure.
for example, i have 3 files.
from myLib.ClassA import ClassA

a = classA()

from myLib.Base.BaseA import BaseA

class ClassA(BaseA):
   def __init__(self):
       print "classA"

if (__name__ == "__main__"):
   print "test class A"
   a = ClassA()
   print a

class BaseA:
   def __init__(self):
     print "BaseA"

It's fine when i run
however when i run individually, it would fail in import
statment since the import path is incorrect.
I would like to know is something wrong in my design, or something i

Also, in practical usage, is that one class in one py file?


a python newbie

More information about the Python-list mailing list