本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)), '.')