I have a Python class called \"ClassA\" and another Python class which is supposed to import ClassA which is \"ClassB\". The directory structure is as follows:
You really should be using packages. Then MainDir is placed at a point in the file system on sys.path (e.g. .../site-packages), then you can say in ClassB:
from MainDir.Dir.DirA import ClassA # which is actually a module
You just have to place files named __init__.py in each directory to make it a package hierarchy.