473,473 Members | 1,415 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Auto locate Python's .so on Linux (for cx_Freeze's --shared-lib-name)

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
Nov 17 '07 #1
3 1805
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
How about run python -v yourscript and filter the output?

Nov 18 '07 #2
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
pydef 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
...
pyfindaso('_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
Nov 18 '07 #3
Neal Becker 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

How about run python -v yourscript and filter the output?
for examples here python -v delivers many other python module
paths, but not Python's .so. For example

/usr/lib/libpython2.4.so.1.0

Robert
Nov 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paolo Scolamacchia | last post by:
Hi everybody, this is my environment : Apache is installed on a Linux server (RedHat9A) and I launch the browser on a PC running WindowsXP to execute php scripts on the Linux server. I would run...
2
by: Johan den Boer | last post by:
Hi, How to find out the last insert primary key value when a field is auto incremented. Select the maximum value from the table is not an option because users can add rows very quickly. First...
1
by: Bill Menees | last post by:
VS.NET 2003 defaults the "Debugger Type" property to "Auto" for Visual C++ projects. Unfortunately, the "Auto" type isn't very smart. "Auto" bases the debugger type on the launched EXE's type,...
1
by: Steve.Goodman | last post by:
Appologies if this has already been asked, but after scanning the web and this news group I could find no decent solution. We have a windows App that calls a webservice, using this bit of basic...
2
by: xiebopublic | last post by:
Hi all, Is there C/C++ corresponding function in Linux for Java's java.util.Locale.getCountry? Thanks! Best Regards, Xie, Bo
3
by: Levi Campbell | last post by:
Hi, I'm trying to write a program for a friend of mine who uses windows but I use GNU/Linux. I know you can use mingw and link to the python dll, but is there a way to create a win32 service under...
1
Nepomuk
by: Nepomuk | last post by:
You might have heard about Linux, but you don't know what it is? Or you know a few things about it, but they terrify you? Well, then this article is for you. Don't be afraid - Everyone can use Linux!...
7
by: blindaviator | last post by:
I am trying to setup a webpage in PHP to auto generate a table filled with text boxes for a form submission.. Is this possible to do in PHP?? Basically what I need to do is have a main page...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.