递归火山软件开发平台

标题: 这个dll能不能再火山调用 [打印本页]

作者: 肉丝    时间: 2025-3-5 15:50
标题: 这个dll能不能再火山调用
本帖最后由 肉丝 于 2025-3-5 15:57 编辑

def __init__(self):
    self.js_run_time = ctypes.CDLL(r'D:\PythonV8-Ricky\ExportPythonV8DLL.dll')
    self.js_run_time.run_script.argtypes = [ctypes.c_char_p, ctypes.c_char_p]
    self.js_run_time.run_script.restype = ctypes.c_void_p
    self.js_run_time.free_result.argtypes = [ctypes.c_void_p]

def run_script(self, source, fun_name):
    result_ptr = self.js_run_time.run_script(source.encode('utf-8'), fun_name.encode('utf-8'))
    result = ctypes.string_at(result_ptr).decode('utf-8')
    self.js_run_time.free_result(result_ptr)
    return result
来源  https://bbs.125.la/forum.php?mod=viewthread&tid=14848368

//我这个报错[size=13.0667px]<火山程序 类型 = "通常" 版本 = 1 />方法 run_script <公开 静态 类型 = 变整数 @视窗.输入 = "..\\..\\ExportPythonV8DLL.dll" @输出名 = "run_script">参数 script <类型 = 变整数>参数 function <类型 = 变整数>{}




作者: 肉丝    时间: 2025-3-5 16:22
已自行解决




欢迎光临 递归火山软件开发平台 (https://bbs.voldp.com/) Powered by Discuz! X3.4