// Test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "python.h"
int main(int argc, char* argv[])
{
for (int i=0;i<5;i++)
{
Py_Initialize(); /*初始化python解释器,告诉编译器要用的python编译器*/
PyObject *pName,*pModule,*pDict,*pFunc,*pArgs;
pModule = PyImport_ImportModule("psasp2psse");
if ( !pModule ) {
printf("can't find pytest.py");
getchar();
return -1;
}
pFunc = PyObject_GetAttrString(pModule,"main");
//PyEval_CallObject(pFunc,NULL);
PyObject* args = PyTuple_New(1);
//PyObject* arg1 = 'c\dd';
PyTuple_SetItem(args, 0, Py_BuildValue("s","C:\\2016_08_24T04_30_37"));
// PyTuple_SetItem(pArgs, 0, Py_BuildValue("l","C:\\2016_08_24T04_30_37"));
// 调用Python函数
PyObject_CallObject(pFunc, args);
//PyRun_SimpleString("impo