James Stroud wrote: > robert wrote: >> In a makefile I want to locate the .so for a dynamically linked Python >> on Linux. (for cx_Freeze's --shared-lib-name) >> e.g. by running a small script with that Python. How to? >> >> Robert > > def findaso(aso): > import os > for apath in os.sys.path: > if not apath.startswith(os.path.sep): > apath = os.path.join(os.path.curdir, apath) > try: > files = os.listdir(apath) > except OSError: > pass > if aso in files: > return apath > > > py> def findaso(aso): > ... import os > ... for apath in os.sys.path: > ... if not apath.startswith(os.path.sep): > ... apath = os.path.join(os.path.curdir, apath) > ... try: > ... files = os.listdir(apath) > ... except OSError: > ... pass > ... if aso in files: > ... return apath > ... > py> findaso('_tkinter.so') > '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload' > > > James >
I'd need to know already the name and oon this installation it is for example /usr/lib/libpython2.4.so.1.0 /usr/lib is not in sys.path Robert -- http://mail.python.org/mailman/listinfo/python-list