Cross-platform way to get default directory for binary files like console scripts?

Piotr Dobrogost p at google-groups-2014.dobrogost.net
Thu Feb 20 09:27:37 EST 2014


Hi!

Is there cross-platform way to get default directory for binary files (console scripts for instance) the same way one can use sys.executable to get path to the Python's interpreter in cross-platform way?

Context:
There's Python script which runs various tools like pip using subprocess and we would like to make sure we run tools that accompany Python's interpreter used to run this script. Please note that the script may be run from within virtualenv which had not been activated - ./venv/bin/python our_script.py


Regards,
Piotr Dobrogost



More information about the Python-list mailing list