summaryrefslogtreecommitdiff
path: root/find-python-path.py
diff options
context:
space:
mode:
Diffstat (limited to 'find-python-path.py')
-rwxr-xr-xfind-python-path.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/find-python-path.py b/find-python-path.py
new file mode 100755
index 0000000..21ecb12
--- /dev/null
+++ b/find-python-path.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+
+import sys
+from os.path import split, basename
+
+def find_path ():
+ for path in sys.path:
+ (head, tail) = split (path)
+ if tail == 'site-packages':
+ base = basename (head)
+ print base + '/' + tail
+ return
+
+find_path ()