Calling function in shared lib

Thomas Heller theller at python.net
Wed Jun 4 12:17:09 EDT 2003


Olaf Wasmuth <owasmuth at web.de> writes:

> I am trying to write python code that is able to invoke
> a function that was compiled into a shared library
> (actually, FORTRAN routines).  I did succeed for a specific
> routine in a specific library, but now I want to do this
> in a more flexible way.
> 
> That is, given the library path and the "signature" of the
> routine (e.g. from a configuration file) at run time, I
> would like to call this function from within Python. My
> target platform is Unix (Solaris), so I'm thinking of
> using the GNU libltdl to access the library and do the
> call. But how can I feed the parameters into it ? Did
> anybody do this already, or do you have some pointers
> for me ?

Sounds almost like ctypes:
http://starship.python.net/crew/theller/ctypes/
although I've never heard it runs on Solaris.

But I'll gladly accept patches!

Thomas




More information about the Python-list mailing list