Python equivilent to dlopen/dlsym ?

Nhi Vanye offer at sgi.com
Fri Jun 1 13:59:17 EDT 2001


$ from mwh at python.net -#142634 | sed "1,$s/^/> /"
>
>
>offer at sgi.com (Nhi Vanye) writes:
>
>> What would be the python equivilent of dlopen()/dlsym(). I'm trying to
>> prototype some C code that will use dlopen to open a shared library and
>> ldsym() to call a particular function in it.
>> 
>> The python file that implements the functions is listed in a runtime
>> configuration file. Because the configuration file will list multiple
>> python modules that each have the same function defined (I'll will chain
>> them when I call them) I don't want to pollute the name spaces.
>> 
>> Any clues ?
>
>Does execfile do what you want:
>
>d = {}
>execfile("/path/to/file.py",d,d)
>sym = d[symbol_name]
>
>?  If not, I'm not sure what you're after.

Good enough.

Thanks.

>
>Cheers,
>M.
>


richard.
-- 
Richard Offer                         Technical Lead, Trust Technology.
"Specialization is for insects"
__________________________________________http://reality.sgi.com/offer/




More information about the Python-list mailing list