module search path

From: Ajay (abra9823_at_mail.usyd.edu.au)
Date: 07/30/04


Date: Fri, 30 Jul 2004 12:20:13 +1000
To: python-list@python.org

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.



Relevant Pages

  • Re: help with php.ini include_path?
    ... bobmct wrote: ... their own directory structure. ... common "working" includes directory. ... deleting all files as you go). ...
    (comp.lang.php)
  • help with php.ini include_path?
    ... their own directory structure. ... common "working" includes directory. ... further on down the tree. ... I've added the recursed directories to my php.ini include_paths directive ...
    (comp.lang.php)
  • Re: help with php.ini include_path?
    ... common "working" includes directory. ... Another way is to rewrite the files to use relative addressing, ... The PayPal directory structure is exactly ... I was HOPING that php includes would be recursive but it appears not. ...
    (comp.lang.php)