Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

c++ÖÐǶÈëpythonÄ£¿éÖ¸ÕëΪ¿Õ,Ϊʲô

#include <Python.h>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
vector <string> results;
PyObject *module,*liststr,*dic,*fun,*argss;
Py_ssize_t slen;
Py_Initialize();
if (!Py_IsInitialized())
{
cout < <"fail!" < <endl;
return 0;
}
        //ÏÂÃæÕâ¾ä¶¼ÄÜÕý³£Ö´ÐУ¬ËµÃ÷»·¾³ÉèÖÃÓ¦¸ÃûÎÊÌâ
PyRun_SimpleString("print('hello')");
        //ÕâÒÔºóµÄ¾Í²»ÐÐÁË£¬µ¼ÈëÄ£¿éÖ¸ÕëΪ¿Õ
module=PyImport_ImportModule("Helper");
if (!module)
{
return 0;
}
dic = PyModule_GetDict(module);
fun = PyDict_GetItemString(dic,"GetTokenizeResult");
argss = Py_BuildValue("(ss)","ds|fef|ggg|fes|fe","|");
liststr = PyObject_CallObject(fun,argss);
slen = PyList_Size(liststr);
for (int i=0;i <slen;i++)
{
string restr;
PyArg_Parse(PyList_GetItem(liststr,i),"s",&restr);
results.push_back(restr);
}
Py_Finalize();
return 0;
}

Çë´óÏÀÃǰïæ¿´¿´Ôõô»ØÊ£¬ÎÊÌâÔÚ´úÂë×¢ÊÍÖУ¬»·¾³vs2005 python3.0¶øÇÒÏîÄ¿ÖеÄ×Ö·û¼¯×öÁ˸÷ÖÖÉèÖû¹ÊDz»ÐУ¬ÎÒ°ÑpythonµÄpy,ºÍÉú³ÉµÄpycÎļþÒ»Æð¿½µ½c++¹¤³


Ïà¹ØÎÊ´ð£º

ÓÃC»òC++ÈçºÎ±àдÇó½â3Dħ·½³ÌÐò - C/C++ / C++ ÓïÑÔ

ÇëÎÊÓÃC»òC++ÈçºÎ±àдÇó½â3Dħ·½µÄ³ÌÐò£¬¸Ã´ÓºÎ¿ªÊ¼£¿
лл¸÷룬°ïæÌáµã½¨Òé°É¡£

http://www.mofang.net/code/176/182/6581.html

ÎÒÖ»ÄÜÍ»ÆÆ60Ã룡°¦¡£

ÎÒ¸Õ¹ý40Ãë

googleµÄandroidÖÐÓиöOpenGL ES + ......

ÈçºÎ²éÕÒϵͳδ°²×°²¹¶¡C - C/C++ / ÐÂÊÖÀÖÔ°

ÇëÎʸ÷λ¸ßÊÖÈçºÎÓÃC/C++»ñµÃϵͳδ°²×°²¹¶¡
ºÃÏñºÜרҵµÄ¶«Î÷¡£¡£¡£

²é×¢²á±í
ÿ¸ö²¹¶¡Èç¹û°²×°Á˶¼»áÔÚ×¢²á±íÀïÃæµÇ¼Ç

ÇëÎÊÄܲ»ÄܸüÇåÎúЩ£¬ÎÒÏëÓÃc\c++²é³öÀ´£¬²»ºÃÒâ˼£¬ÎÒÊÇÐÂÊÖ¡£»¹ÍûÖ¸½Ì¡£Ð»

·ÖÖµ ......

python Òì³£Í˳ö

×î½üÓÃpythonдһ¸ö³ÌÐò,×ÜÊÇÒì³£Í˳ö£¬µ«ÊÇȴû·¨ÓÃtry..exceptÀ´²¶×½

ÓÉÓÚû·¨·¢Í¼Æ¬£¬ËùÒÔ°ÑÏà¹ØµÄÐÅÏ¢´òÓ¡³öÀ´
Òì³£µÄÐÅÏ¢´óÖÂÈçÏ£º

python.exeÓöµ½ÎÊÌâÐèÒª¹Ø±Õ¡£ÎÒÃǶԴËÒýÆðµÄ²»±ã±íʾ±§Ç¸ ......

³õѧPYTHON£¬´ó¼ÒÖ÷ÒªÓÃËüÀ´×öʲô

    ¸Õ½Ó´¥£¬¸Ð¾õ¹¦ÄܱȽÏÇ¿´ó£¬Ö÷ÒªÊÇÕ³ºÏÐԺ㬿ÉÒÔÓлú½áºÏÆäËûÓïÑÔ¡£µ«²»Ã÷°×ËüÖ÷ÒªÓ¦ÓÃÓÚʲôÁìÓò£¬Ö÷Òª×öÄÇ·½ÃæµÄ¶«¶«¡£¿ª·¢ERPϵͳÊÇ·ñ¿ÉÐУ¿
»ù±¾ÉÏʲô¶¼¿ÉÒÔ×ö

½ñÌìÈ¥¿´ÁËһϣ¬»ù±¾ÉÏʲô ......

C ³ÌÐòÎÊÌâ (Èý) - C/C++ / CÓïÑÔ

ÎÊÌâÒ»£º
ÔÚ¶ÔÆëΪ4µÄÇé¿öÏÂ
struct BBB
{
long num£»
char *name;
short int data;
char ha;
short ba[5];
}*p;
p=0x1000000;
p+0x200=____;
(Ulong)p+0x200=____;
(char*)p+0x200=____;
¼ÙÉèÔÚ32λC ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ