System default sys.path

Brock Pytlik bpytlik at Sun.COM
Wed Jul 1 22:48:04 EDT 2009


Hi, I'm trying to find a way to get the value sys.path would have on a 
particular system if python was started with an empty python path. I do 
want it to include the site specific additional paths. I know I can hack 
this information myself, but I'd rather be able to get this on demand so 
that if things change in the future, I don't have grovel around looking 
for which directory string to change.

If nothing else, I think the following would satisfy my needs:
1) a variable containing the directories to use as a prefix (I think 
sys.exec_prefix and sys.prefix are what I want here)
2) a variable containing the list of suffixes that are applies to the 
prefixes, like lib/python<version>/site-packages
3) a way of handing the *.pth files

Thanks in advance for the help,
Brock



More information about the Python-list mailing list