Did I find the right examples for you? yes no

All Samples(49)  |  Call(39)  |  Derive(0)  |  Import(10)

            def load_library(libname, loader_path):
        if ctypes.__version__ < '1.0.1':
            import warnings
            warnings.warn("All features of ctypes interface may not work " \
                          "with ctypes < 1.0.1")

        ext = os.path.splitext(libname)[1]
        if not ext:
            # Try to load library with platform-specific name, otherwise
            # default to libname.[so|pyd].  Sometimes, these files are built
            # erroneously on non-linux platforms.
            from numpy.distutils.misc_util import get_shared_lib_extension
            so_ext = get_shared_lib_extension()
            libname_ext = [libname + so_ext]
            # mac, windows and linux >= py3.2 shared library and loadable
            # module have different extensions so try both
            so_ext2 = get_shared_lib_extension(is_python_ext=True)
            if not so_ext2 == so_ext:
                libname_ext.insert(0, libname + so_ext2)
        else:
            libname_ext = [libname]

        loader_path = os.path.abspath(loader_path)
        if not os.path.isdir(loader_path):
            libdir = os.path.dirname(loader_path)
        else:
            libdir = loader_path

        for ln in libname_ext:
            libpath = os.path.join(libdir, ln)
            if os.path.exists(libpath):
                try:
                    return ctypes.cdll[libpath]
                except OSError:
                    ## defective lib file
                    raise
        ## if no successful return in the libname_ext loop:
        raise OSError("no file with expected extension")
        


src/n/u/numscons-0.12.0/tests/examples/ctypesext/foo_py.py   numscons(Download)
try:
	from numpy.ctypeslib import load_library
	_FOO = load_library("foo", __file__)
	def foo():
	    _FOO.foo()

src/n/u/numscons-HEAD/tests/examples/ctypesext/foo_py.py   numscons(Download)
try:
	from numpy.ctypeslib import load_library
	_FOO = load_library("foo", __file__)
	def foo():
	    _FOO.foo()

src/p/y/python-register-HEAD/imreg/samplers/sampler.py   python-register(Download)
import scipy.ndimage as nd
 
from numpy.ctypeslib import load_library
from numpyctypes import c_ndarray
import ctypes 
 
libsampler = load_library('libsampler', __file__)

src/o/r/orangecontrib.earth-0.1.3/orangecontrib/earth/core.py   orangecontrib.earth(Download)
from . import _earth
 
_c_earth_lib = ctypeslib.load_library(_earth.__file__, "")
 
_c_earth = _c_earth_lib.Earth

src/s/c/scipy-lecture-notes-HEAD/advanced/interfacing_with_c/ctypes_numpy/cos_doubles.py   scipy-lecture-notes(Download)
 
# load the library, using numpy mechanisms
libcd = npct.load_library("libcos_doubles", ".")
 
# setup the return typs and argument types

src/c/l/classipy-HEAD/classipy/classifiers/libsvm/svm.py   classipy(Download)
# Load library
try:
    libsvm = np.ctypeslib.load_library('libsvm', os.path.abspath(__path__[0] + '../../../lib'))
except OSError:
    libsvm = np.ctypeslib.load_library('libsvm', '.')

src/c/l/classipy-HEAD/classipy/classifiers/liblinear/linear.py   classipy(Download)
# Load library
try:
    liblinear = np.ctypeslib.load_library('liblinear', os.path.abspath(__path__[0] + '../../../lib'))
except OSError:
    liblinear = np.ctypeslib.load_library('liblinear', '.')

src/c/o/colorcorrect-0.04/src/colorcorrect/algorithm.py   colorcorrect(Download)
cutilfolder = os.path.abspath(__file__).rsplit(os.path.sep, 1)[0]
cutilname = "_cutil"
libcutil = np.ctypeslib.load_library(cutilname, cutilfolder)
 
class RGBImage(Structure):

src/t/d/tdl-HEAD/lib/wrhello.py   tdl(Download)
# import the dll
if sys.platform == 'win32':
    hellodll = num.ctypeslib.load_library('_hello.dll',libspath)
else:
    hellodll = num.ctypeslib.load_library('_hello.so',libspath)

src/p/y/pyccv-0.07/src/pyccv/__init__.py   pyccv(Download)
ccvfolder = os.path.abspath(__file__).rsplit(os.path.sep, 1)[0]
ccvname = "_ccv"
libccv = np.ctypeslib.load_library(ccvname, ccvfolder)
 
class RGBImage(Structure):

  1 | 2 | 3  Next