(original) (raw)

import ctypes try: ctypes.CDLL('somelib.so') except OSError as exc: print(exc.errno) print(exc)