python path - pdflib

steve steven.smith at level3.com
Tue Nov 13 09:52:35 EST 2001


"Steve Holden" <sholden at holdenweb.com> wrote in message news:<FIEG7.896$Yh.65238 at atlpnn01.usenetserver.com>...
> You are mistaken in believeing that the Python path (effectively, sys.path)
> affects how the system finds data files. The path mechanism is used only for
> locating modules to be imported. You will therefore need to either locate
> the data files in a known directory or programmatically try the directories
> on the path until you find it.
> 
> Probably a good compromise is having a default location hard-wired into the
> program, but allowing an environment variable (found in the os.environ
> dictionary) to override the default if/when set.
> 
> regards
>  Steve

I tried setting an absolute path also, but this doesn't work.  As I
also said, the first file I try to find, whatever it is, is found. 
After that file is found, I can't find another file, even if it is in
another directory.  Since the absolute path won't work, I would
believe there is something wrong with pythons path abilities.  Is it
possible that after python has found a file in a certain directory,
that it works relative to only that directory?



More information about the Python-list mailing list