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


Python ctypes.RTLD_LOCAL属性代码示例

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


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

示例1: _load_lib

# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import RTLD_LOCAL [as 别名]
def _load_lib():
    """Load library by searching possible path."""
    lib_path = libinfo.find_lib_path()
    lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
    # DMatrix functions
    lib.MXGetLastError.restype = ctypes.c_char_p
    return lib


# version number 
开发者ID:awslabs,项目名称:dynamic-training-with-apache-mxnet-on-aws,代码行数:12,代码来源:base.py

示例2: _load_libzmq

# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import RTLD_LOCAL [as 别名]
def _load_libzmq():
    """load bundled libzmq if there is one"""
    import sys, ctypes, platform, os
    dlopen = hasattr(sys, 'getdlopenflags') # unix-only
    # RTLD flags are added to os in Python 3
    # get values from os because ctypes values are WRONG on pypy
    PYPY = platform.python_implementation().lower() == 'pypy'
    
    if dlopen:
        dlflags = sys.getdlopenflags()
        # set RTLD_GLOBAL, unset RTLD_LOCAL
        flags = ctypes.RTLD_GLOBAL | dlflags
        # ctypes.RTLD_LOCAL is 0 on pypy, which is *wrong*
        flags &= ~ getattr(os, 'RTLD_LOCAL', 4)
        # pypy on darwin needs RTLD_LAZY for some reason
        if PYPY and sys.platform == 'darwin':
            flags |= getattr(os, 'RTLD_LAZY', 1)
            flags &= ~ getattr(os, 'RTLD_NOW', 2)
        sys.setdlopenflags(flags)
    try:
        from . import libzmq
    except ImportError:
        pass
    else:
        # store libzmq as zmq._libzmq for backward-compat
        globals()['_libzmq'] = libzmq
        if PYPY:
            # some versions of pypy (5.3 < ? < 5.8) needs explicit CDLL load for some reason,
            # otherwise symbols won't be globally available
            # do this unconditionally because it should be harmless (?)
            ctypes.CDLL(libzmq.__file__, ctypes.RTLD_GLOBAL)
    finally:
        if dlopen:
            sys.setdlopenflags(dlflags) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:36,代码来源:__init__.py

示例3: __init__

# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import RTLD_LOCAL [as 别名]
def __init__(self):
        self.RTLD_LAZY = 0   # not supported anyway by ctypes
        self.RTLD_NOW  = 0
        self.RTLD_GLOBAL = ctypes.RTLD_GLOBAL
        self.RTLD_LOCAL = ctypes.RTLD_LOCAL 
开发者ID:reBiocoder,项目名称:bioforum,代码行数:7,代码来源:backend_ctypes.py

示例4: _load_lib

# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import RTLD_LOCAL [as 别名]
def _load_lib():
    """Load libary by searching possible path."""
    lib_path = libinfo.find_lib_path()
    lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
    # DMatrix functions
    lib.NNGetLastError.restype = ctypes.c_char_p
    return lib

# version number 
开发者ID:mlperf,项目名称:training_results_v0.6,代码行数:11,代码来源:_base.py

示例5: _load_lib

# 需要导入模块: import ctypes [as 别名]
# 或者: from ctypes import RTLD_LOCAL [as 别名]
def _load_lib():
    """Load library by searching possible path."""
    lib_path = libinfo.find_lib_path()
    lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
    # DMatrix functions
    lib.MXGetLastError.restype = ctypes.c_char_p
    return lib

# version number 
开发者ID:awslabs,项目名称:mxnet-lambda,代码行数:11,代码来源:base.py


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