import sys, ctypes sharedlib = './lib3ddevil1.so' libc = ctypes.cdll.LoadLibrary(sharedlib) if not libc: raise SystemExit("Couldn't load %s" % sharedlib) # Don't need these anymore del sys, sharedlib