Import Error - building a well structured program

I think you need init.py files to “register” a folder as a module. The Python help page you linked refers to this.

EDIT: Oh, you did this already. Have you tried making sure your case is correct? Python is case-sensitive, so Import Panditor may not work as your file name is panditor.py.

Not to be blunt, but the answer is in your original post where you said you understand the syntax is:

from folderName.moduleName import ClassName

In your case the folderName is panditor, the moduleName is panditor (the .py file) and the ClassName is Panditor so you should write:

from panditor.panditor import Panditor

or if you just write “import panditor” than you would access the class as “panditor.panditor.Panditor”

Make sense?

Have you tried importing just panditor, and then accessing the function via panditor.panditor.Panditor? Maybe you could try renaming some files to make it more logical and help with troubleshooting (i.e. panditor.main.Panditor).

It’s a circular import issue, as you can see from the traceback. panditor.py imports levitor.py, which imports grabber.py, which tries to import panditor.py again, resulting in an infinite loop. You have to restructure which module uses which other module.