Simple Python Project Structure

amit amit.uttam at gmail.com
Sat Oct 11 02:17:51 CEST 2008


Hi,

I recently wrote a fairly complex project in python. It works great
and it was completed fairly quickly thanks to python!

Anyways, I am in the process of cleaning the code/directory and I had
a simple question....

How do create my own modules and import them? Right now it works but
they all have to be in the same directory. For example,

project/
....util/
....config/
....tests/
....start.py

I have a module in util/console.py, how do I import that. In start.py
I have:

from project.util.console import filetest

but I get an ImportError.

Thanks!

Amit



More information about the Python-list mailing list