摘要: C调用python的实例。 1. 应用场景 c代码中需要数据库的支持,但是引入数据库十分的复杂且麻烦,所以考虑用python读取配置文件,然后将数据返回到C。 2.调用步骤 a, 添加必要的宏和python路径#define MS_NO_COREDLL#include "C:\Python27\include\python.h"#pragma comment(lib, "C:\\Python27\\libs\\python27.lib") b,初始化python解释器 Py_Initialize(); if ( !Py_IsInitialized() ) 阅读全文
posted @ 2013-05-23 11:29 brackenbo 阅读(891) 评论(0) 推荐(0) 编辑