views:

54

answers:

2

I need to access the Scripts and tcl sub-directories of the currently executing Python instance's installation directory on Windows.

What is the best way to locate these directories?

A: 

Hmm, find the Lib dir from sys.path and extrapolate from there?

djc
no, as the sys.path can be modified and moved around, i didn't want to go this route
Matt Joiner
+3  A: 

Have a look at sys.prefix and sys.exec_prefix

>>> import sys
>>> sys.prefix
'/System/Library/Frameworks/Python.framework/Versions/2.6'
>>> sys.exec_prefix
'/System/Library/Frameworks/Python.framework/Versions/2.6'
ChristopheD