py_mini_racer.py 文件源码

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

项目:PyMiniRacer 作者: sqreen 项目源码 文件源码
def __init__(self):
        """ Init a JS context """

        self.ext = ctypes.CDLL(EXTENSION_PATH)

        self.ext.mr_init_context.restype = ctypes.c_void_p
        self.ext.mr_eval_context.argtypes = [
            ctypes.c_void_p,
            ctypes.c_char_p,
            ctypes.c_int]
        self.ext.mr_eval_context.restype = ctypes.POINTER(PythonValue)

        self.ext.mr_free_value.argtypes = [ctypes.c_void_p]

        self.ext.mr_free_context.argtypes = [ctypes.c_void_p]

        self.ctx = self.ext.mr_init_context()

        self.lock = threading.Lock()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号