易截截图软件、单文件、免安装、纯绿色、仅160KB

python和c++混合编程的一个比较简单的问题 大家来看看

#include "stdafx.h"
#include <boost/python/def.hpp>
#include <boost/python/module.hpp>
#include <boost/python/args.hpp>
#include <boost/python/class.hpp>
#include <boost/python/str.hpp>
#include <boost/python/dict.hpp>
#include <iostream>
#include <string>
#include <list>
#include <map>

using namespace std;

PyObject * RepeatString (PyObject *pSelf, PyObject *pParams)
{
char *pstrString;
int iRepCount;
PyArg_ParseTuple(pParams, "si", &pstrString, &iRepCount);
for (int i = 0; i < iRepCount; i++)printf("---%d\n", i);
return PyInt_fromLong(iRepCount);
}


int _tmain(int argc, _TCHAR* argv[])
{
Py_Initialize();
Py_IsInitialized();
PyImport_AddModule("HostAPI");

//create a function table
PyMethodDef HostAPIFuncs [] =
{
{"RepeatString", RepeatString, METH_VARARGS, NULL},
{NULL, NULL, NULL, NULL}   
};

//initial the module with the function table
Py_InitModule("HostAPI", HostAPIFuncs);

PyObject *pName = PyString_fromString("helloworld");
PyObject * pModule = PyImport_Import(pName);
PyObject *pstr= NUL


相关问答:

C 程序问题 (二) - C/C++ / C语言

问一下:
#include <stdio.h>
int main()
{
  char x, y, z;
  int i;
  int a[16];
  for(i=0; i<=16; i++)
  {
  a[i] = 0;
  ......

Python中的Unicode在Delphi如何还原成Gb2312?

已知Python 中:
s = unicode("测试", "gb2312")
s = u'\u6d4b\u8bd5'
print s
测试

在Delphi里面如何将\u6d4b\u8bd5这样的还原成Gb2312的汉字呢?
找到个方法
......

python怎么print 'hello world'

大家好,我是一个新手,刚开始学python,但是刚开始的helloworld都没法打印,让我很无奈。
我的python安装路径为f:\python31。在path中也设置对了,在windows下运行是这样显示的,希望各位前辈指点一下。谢谢
Pyth ......

请教一题C,我看不明白! - C/C++ / C语言

#include "stdio.h"
void main()
{
  int *p;
  int a[10]={0,1,2,3,4,5,6,7,8,9};
  int k=0;
  p=a;
  for(int i=0;i<10;i++,p ......

C/C++里屏shift+f10键要怎么写! - C/C++ / C++ 语言

SHIFT加F10与那个键右ctrl边上的那个键功能一样,想屏这个
但不知要怎么写那个组合键!
有没哪个大侠放一段这个的代码或写一段
http://topic.csdn.net/u/20090609/15/7dc9fb70-243f-4070-9cfd-34e48b66e6c6.html ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号