All Samples(1075) | Call(464) | Derive(1) | Import(610)
An instance of this class represents a loaded dll/shared library, exporting functions using the standard C calling convention (named 'cdecl' on Windows). The exported functions can be accessed as attributes, or by indexing with the function name. Examples: <obj>.qsort -> callable object <obj>['qsort'] -> callable object Calling the functions releases the Python GIL during the call and reacquires it afterwards.
src/p/y/pygtk-HEAD/examples/gtk/mirror.py pygtk(Download)
#hacks for using functions not exposed in this pygtk version
import ctypes
cgdk = ctypes.CDLL("libgdk-x11-2.0.so")
DBG = True
src/p/y/pygccxml-HEAD/pyplusplus_dev/examples/gmplib_dev/pygmplib/__init__.py pygccxml(Download)
# This file has been generated by Py++. import ctypes import ctypes_utils libgmp_lib = ctypes.CDLL( r"/usr/lib/libgmp.so.3.5.0" )
src/p/y/pygccxml-HEAD/pyplusplus_dev/examples/libmemcached_dev/pymemcached/__init__.py pygccxml(Download)
# This file has been generated by Py++. import ctypes import ctypes_utils libmemcached_lib = ctypes.CDLL( r"/home/roman/language-binding/sources/pyplusplus_dev/examples/libmemcached_dev/libmemcached-0.31/libmemcached/.libs/libmemcached.so" )
src/l/a/LabJackPython-HEAD/src/u12.py LabJackPython(Download)
def _loadLinuxSo():
try:
l = ctypes.CDLL("liblabjackusb.so", use_errno=True)
except TypeError:
l = ctypes.CDLL("liblabjackusb.so")
l.LJUSB_Stream.errcheck = errcheck
l.LJUSB_Read.errcheck = errcheck
return l
def _loadMacDylib():
try:
l = ctypes.CDLL("liblabjackusb.dylib", use_errno=True)
except TypeError:
l = ctypes.CDLL("liblabjackusb.dylib")
src/l/a/LabJackPython-HEAD/src/LabJackPython.py LabJackPython(Download)
def _loadLinuxSo():
"""
Attempts to load the liblabjackusb.so for Linux.
"""
try:
l = ctypes.CDLL("liblabjackusb.so", use_errno=True)
except TypeError:
l = ctypes.CDLL("liblabjackusb.so")
def _loadMacDylib():
"""
Attempts to load the liblabjackusb.dylib for Mac OS X.
"""
try:
l = ctypes.CDLL("liblabjackusb.dylib", use_errno=True)
except TypeError:
l = ctypes.CDLL("liblabjackusb.dylib")
src/p/y/python-iptables-HEAD/iptc/xtables.py python-iptables(Download)
class XTablesError(Exception):
"""Raised when an xtables call fails for some reason."""
_lib_xtables = ct.CDLL('libxtables.so.2', mode=ct.RTLD_GLOBAL)
_lib_xtwrapper = ct.CDLL('libxtwrapper.so')
_throw = _lib_xtwrapper.throw_exception
src/p/y/pyinotify-HEAD/python2/pyinotify.py pyinotify(Download)
pass # Will attemp to load it with None anyway.
if sys.version_info[0] >= 2 and sys.version_info[1] >= 6:
LIBC = ctypes.CDLL(libc, use_errno=True)
def _strerrno():
code = ctypes.get_errno()
return ' Errno=%s (%s)' % (os.strerror(code), errno.errorcode[code])
strerrno = _strerrno
else:
LIBC = ctypes.CDLL(libc)
strerrno = lambda : ''
# Check that libc has needed functions inside.
if (not hasattr(LIBC, 'inotify_init') or
# Check that libc has needed functions inside.
if (not hasattr(LIBC, 'inotify_init') or
not hasattr(LIBC, 'inotify_add_watch') or
not hasattr(LIBC, 'inotify_rm_watch')):
raise UnsupportedLibcVersionError()
src/p/y/pypy3-HEAD/pypy/lib/ctypes_support.py pypy3(Download)
if sys.platform == 'win32':
import _rawffi
standard_c_lib = ctypes.CDLL('msvcrt', handle=_rawffi.get_libc())
else:
standard_c_lib = ctypes.CDLL(ctypes.util.find_library('c'))
src/p/y/pyinotify-HEAD/python3/pyinotify.py pyinotify(Download)
except IOError as err:
pass
LIBC = ctypes.CDLL(libc, use_errno=True)
# Check that libc has needed functions inside.
if (not hasattr(LIBC, 'inotify_init') or
not hasattr(LIBC, 'inotify_add_watch') or
not hasattr(LIBC, 'inotify_rm_watch')):
src/p/y/pypy-HEAD/lib_pypy/ctypes_support.py pypy(Download)
if sys.platform == 'win32':
import _rawffi
standard_c_lib = ctypes.CDLL('msvcrt', handle=_rawffi.get_libc())
else:
standard_c_lib = ctypes.CDLL(ctypes.util.find_library('c'))
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next