views:

495

answers:

2

Anybody knows if actually exists a wrapper or ported library to access to Unix dynamic linker on Python?

+5  A: 

Would ctypes do what you want?

Devin Jeanpierre
+1  A: 

The module is called dl:

>>> import dl
>>> dl.open("libfoo.so")
<dl.dl object at 0xb7f580c0>
>>> dl.open("libfoo.so").sym('bar')
1400432

... though it's nasty and you might want to consider using ctypes or an extension module.

Edit

Apparently, dl is deprecated in 2.6 so you'll want to use ctypes which has a better API anyhow.

Aaron Maenpaa
deprecation of dl in favor of ctypes confirms that my near-guess of an answer was correct. *phew*.
Devin Jeanpierre