我找不到这方面的相关信息。对于 lua,如果你想从 main() C 函数执行一个 test.lua 文件,你调用lua_dofile("test.lua")
. 什么是 python 等价物?
问问题
118 次
2 回答
2
如果要嵌入 Python,请使用PyRun_SimpleFile
:
FILE *fp = fopen("test.py", "r");
int ret = PyRun_SimpleFile(fp, "test.py");
if(ret < 0) {
/* exception occurred */
}
于 2013-02-24T17:36:29.060 回答