I'm having some trouble getting importing stuff from another class, I think I may be doing it wrong.

I have a simple main class called Test and at the top I say:

from WordFixer import WordFixer
import sys

Then in the same folder (the src folder) I have a file called WordFixer.py and it's heading says:

class WordFixer:

but I'm getting an error in Test that says "Unresolved import: WordFixer"

What am I doing wrong?

Well it seems to work now although I'm not sure why...I commented out the line and uncommented it a little bit later. I'm using eclipse. Maybe I should have forced it to compile or something.

Sometimes, if the module isn't in the same place, it is a matter of the path. At the begging of your progam you can do something like:

import sys
sys.path.append('/path/tomy/module')
from MyMod import moduleA

However I don't know how Eclipse as an IDE differs in terms of working directory...

either

I guess ungalcrys has left Python a long time ago.
This is his only post over 4 year ago,look at dates.

This question has already been answered. Start a new discussion instead.