当前位置: 首页>>代码示例>>Python>>正文


Python ctypeslib.load_library方法代码示例

本文整理汇总了Python中numpy.ctypeslib.load_library方法的典型用法代码示例。如果您正苦于以下问题:Python ctypeslib.load_library方法的具体用法?Python ctypeslib.load_library怎么用?Python ctypeslib.load_library使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在numpy.ctypeslib的用法示例。


在下文中一共展示了ctypeslib.load_library方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_basic

# 需要导入模块: from numpy import ctypeslib [as 别名]
# 或者: from numpy.ctypeslib import load_library [as 别名]
def test_basic(self):
        try:
            # Should succeed
            load_library('_multiarray_umath', np.core._multiarray_umath.__file__)
        except ImportError as e:
            msg = ("ctypes is not available on this python: skipping the test"
                   " (import error was: %s)" % str(e))
            print(msg) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:10,代码来源:test_ctypeslib.py

示例2: test_basic2

# 需要导入模块: from numpy import ctypeslib [as 别名]
# 或者: from numpy.ctypeslib import load_library [as 别名]
def test_basic2(self):
        # Regression for #801: load_library with a full library name
        # (including extension) does not work.
        try:
            try:
                so = get_shared_lib_extension(is_python_ext=True)
                # Should succeed
                load_library('_multiarray_umath%s' % so, np.core._multiarray_umath.__file__)
            except ImportError:
                print("No distutils available, skipping test.")
        except ImportError as e:
            msg = ("ctypes is not available on this python: skipping the test"
                   " (import error was: %s)" % str(e))
            print(msg) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:16,代码来源:test_ctypeslib.py

示例3: test_basic

# 需要导入模块: from numpy import ctypeslib [as 别名]
# 或者: from numpy.ctypeslib import load_library [as 别名]
def test_basic(self):
        try:
            # Should succeed
            load_library('multiarray', np.core.multiarray.__file__)
        except ImportError as e:
            msg = ("ctypes is not available on this python: skipping the test"
                   " (import error was: %s)" % str(e))
            print(msg) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:10,代码来源:test_ctypeslib.py

示例4: test_basic2

# 需要导入模块: from numpy import ctypeslib [as 别名]
# 或者: from numpy.ctypeslib import load_library [as 别名]
def test_basic2(self):
        # Regression for #801: load_library with a full library name
        # (including extension) does not work.
        try:
            try:
                so = get_shared_lib_extension(is_python_ext=True)
                # Should succeed
                load_library('multiarray%s' % so, np.core.multiarray.__file__)
            except ImportError:
                print("No distutils available, skipping test.")
        except ImportError as e:
            msg = ("ctypes is not available on this python: skipping the test"
                   " (import error was: %s)" % str(e))
            print(msg) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:16,代码来源:test_ctypeslib.py

示例5: test_basic

# 需要导入模块: from numpy import ctypeslib [as 别名]
# 或者: from numpy.ctypeslib import load_library [as 别名]
def test_basic(self):
        try:
            cdll = load_library('multiarray',
                                np.core.multiarray.__file__)
        except ImportError as e:
            msg = "ctypes is not available on this python: skipping the test" \
                  " (import error was: %s)" % str(e)
            print(msg) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:10,代码来源:test_ctypeslib.py

示例6: test_basic2

# 需要导入模块: from numpy import ctypeslib [as 别名]
# 或者: from numpy.ctypeslib import load_library [as 别名]
def test_basic2(self):
        """Regression for #801: load_library with a full library name
        (including extension) does not work."""
        try:
            try:
                so = get_shared_lib_extension(is_python_ext=True)
                cdll = load_library('multiarray%s' % so,
                                    np.core.multiarray.__file__)
            except ImportError:
                print("No distutils available, skipping test.")
        except ImportError as e:
            msg = "ctypes is not available on this python: skipping the test" \
                  " (import error was: %s)" % str(e)
            print(msg) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:16,代码来源:test_ctypeslib.py

示例7: load

# 需要导入模块: from numpy import ctypeslib [as 别名]
# 或者: from numpy.ctypeslib import load_library [as 别名]
def load(self, soname):
        """
        Load a compiled shared object.

        Parameters
        ----------
        soname : str
            Name of the .so file (w/o the suffix).

        Returns
        -------
        obj
            The loaded shared object.
        """
        return npct.load_library(str(self.get_jit_dir().joinpath(soname)), '.') 
开发者ID:devitocodes,项目名称:devito,代码行数:17,代码来源:compiler.py


注:本文中的numpy.ctypeslib.load_library方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。