File: site-packages-path.py

package info (click to toggle)
pydb 1.19-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,952 kB
  • ctags: 1,412
  • sloc: python: 3,065; perl: 2,479; sh: 586; makefile: 555; lisp: 265; ansic: 16
file content (17 lines) | stat: -rwxr-xr-x 406 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/python
#$Id: site-packages-path.py,v 1.1 2006/01/11 04:10:32 rockyb Exp $
"""Find where site-path is located.
We print the first location and exit with code 0.
If we don't find the path, exit with code 1.
"""
import sys, os.path
for dir in sys.path:
    short_dir=os.path.basename(dir)
    if short_dir == 'site-packages':
        print dir
        sys.exit(0)
#Not found
sys.exit(1)