Q:

How to organize files properly in Python projects

I am having some difficulty with projects in Python. This is with reference to Qn 48 of Learn Python the Hard Way.
The line of the tester lexicon_tests.py that's throwing up a problem:
from ex48 import lexicon

The error I am seeing is:
ImportError: no module named ex48

I wonder if this is because I haven't organized my files properly within the projects folder: I have a folder named ex48, subfolders of which include tests and lexicon. Within lexicon, I have the file lexicon.py. Within tests, I have the file lexicon_tests.py
Is there an error in the above organization?
EDIT: Posting the code here -
In /ex48, I have setup.py
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

config = {
    'description': 'My Project',
    'author': 'MyName',
    'url': 'URL to get it at.',
    'download_url': 'Where to download it.',
    'author_email': 'My email.',
    'version': '0.1',
    'install_requires': ['nose'],
    'packages': ['ex48'],
    'scripts': [],
    'name': 'projectname'
}

setup(**config)

in /ex48/lexicon, I have lexicon.py
class lexicon:
    @staticmethod

    def scan(string):   

        direction = ['north', 'south', 'east', 'west', 'down', 'up', 'left',          'right', 'back']
        verbs = ['go','stop','kill','eat']
        stop = ['the','in', 'of', 'from', 'at','it']
        nouns = ['door', 'bear', 'princess', 'cabinet']

        words = string.split()

        result = []
        for word in words:
                if word in direction:
                result.append(('direction',word))

and so on . .  . with return result at the end. All the environment variables have been correctly added. The error I see is ImportError with the name lexicon.

A:

For this
from ex48 import lexicon
result = lexicon.scan("north south east")

to work, you should put lexicon.py in the folder ex48, and lexicon.py should contain a scan function at module level, not as a class method.
With your current code, where you have a class lexicon in module lexicon in package lexicon, the import statement would have to look like
from ex48.lexicon.lexicon import lexicon

