psutils.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:picosdk-python-examples 作者: picotech 项目源码 文件源码
def make_symbol(ldlib, name, symbol, restype, argtypes):
    """ Helper for library symbols generation
    :param ldlib: loaded library reference
    :param name: function call to use
    :param symbol: library symbol to attach function to
    :param restype: library symbol return type
    :param argtypes: list of library symbol parameters
    :return: None
    """
    try:
        ldlib[name] = ldlib.lib[symbol]
        ldlib[name].restype = restype
        ldlib[name].argtypes = argtypes
    except AttributeError:
        print ldlib.name, name, "import(%d): Symbol not found" % sys.exc_info()[-1].tb_lineno
    except TypeError:
        pass
    except Exception as ex:
        print name, "import(%d):" % sys.exc_info()[-1].tb_lineno, ex, type(ex)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号