1

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?

2 Answers 2

3

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'
Sign up to request clarification or add additional context in comments.

Comments

0

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

1 Comment

no, as the sys.path can be modified and moved around, i didn't want to go this route

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.