The Assimilation Project  based on Assimilation version 1.1.7.1474836767
install-path.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 #
4 # This file is part of the Assimilation Project.
5 #
6 # Copyright (C) 2011, 2012, 2013 - Alan Robertson <alanr@unix.sh>
7 #
8 # The Assimilation software is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # The Assimilation software is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with the Assimilation Project software. If not, see http://www.gnu.org/licenses/
20 #
21 #
22 '''
23 Program to output where we should locate our installed python code for the system.
24 It is known to work for at least some Ubuntu versions. Hope it works elsewhere ;-)
25 
26 There is no doubt a more wonderful pythonic way to do it. If you read this and
27 know of this better way, please let us know, and we'll fix it.
28 '''
29 import sys
30 try :
31  print([p for p in sys.path if p.endswith("/dist-packages")][0])
32 except IndexError:
33  print([p for p in sys.path if p.endswith("/site-packages")][0])