// py_ex_call_method.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include <eter/py_tinker.h>

py_tinker::object g_inst;

void SetInst(PyObject* poInst)
{
	using namespace py_tinker;

	g_inst = poInst;
	g_inst.call_method("Run", "haha", 1, 2);

	int ret = g_inst.call_method("Sum", 3, 4);
	printf("result = %d\n", ret);

	int ret2=g_inst.call_method("Divide", 9, 3);
	printf("divide = %d\n", ret2);
}	


void initeter()
{
	py_tinker::module_("eter")
		.defv("SetInst", SetInst)
		;
}

int main(int argc, char* argv[])
{
	Py_Initialize();
	Py_SetProgramName((char*)"py_test");
			
	initeter();
	py_tinker::PyEmbed_RunMainFile("ex_call_static_method.py");
	Py_Finalize();	

	return 0;
}
