module search path

Ajay abra9823 at mail.usyd.edu.au
Thu Jul 29 22:20:13 EDT 2004


hi!

I have the following directory structure.

home
   user
     index.cgi
   common
     utils.py

within index.cgi, import utils throws an errors.

I did the following

sys.path.append('../')

and then tried import common.utils and it still throws an error

it works if i give the full path name to common and add that to sys.path as
sys.path.append('/usr/hons/abrar1/lib/html/hons/um/home/common')

My question is why doesn't it work when i add the path to the parent
directory and try import common.utils?

why doesn't that work?

I dont want to rely on the full absolute path

cheers

ajay







----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Python-list mailing list