16.6 dl -- Call C functions in shared objectsAvailability: Unix. The dl module defines an interface to the dlopen() function, which is the most common interface on Unix platforms for handling dynamically linked libraries. It allows the program to call arbitrary functions in such a library. Warning: The dl module bypasses the Python type system and error handling. If used incorrectly it may cause segmentation faults, crashes or other incorrect behaviour.
Note:
This module will not work unless
The dl module defines the following function:
The dl module defines the following constants:
The dl module defines the following exception:
Example:
>>> import dl, time >>> a=dl.open('/lib/libc.so.6') >>> a.call('time'), time.time() (929723914, 929723914.498) This example was tried on a Debian GNU/Linux system, and is a good example of the fact that using this module is usually a bad alternative.
See About this document... for information on suggesting changes. |