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

PythonǶÈëC++

PythonǶÈëC++Ïê½â(1)--HelloWorld
À´CSDNµÄʱºò£¬¸Õ¸Õ½Ó´¥Python£¬ÄÇʱºò¶ÔPythonµÄǶÈ벿·ÖºÜ¸ÐÐËȤ£¬Ö»ÊÇһֱûÓÐʱ¼äÀ´ÅªÇåÆäÃæÉ´£¬Òò´ËҲһֱûÓÐʹÓÃǶÈëµÄ¹¦ÄÜ£¬ÁíÒ»¸öÔ­ÒòÊÇÎÒ»¹Ã»ÓÐÕæÕýÓÃPythonд¹ýÒ»¸öÕýʽµÄÓÐÓõãµÄ¶«Î÷£¬²»¹ý£¬ÏÖÔڻعýÍ·À´¼ÌÐø¿´ÕâÒ»²¿·Ö£¬·¢ÏÖ»¹ÊÇͦ¼òµ¥µÄ¡£ÒÔÇ°Ïë°ÑÕⲿ·Ö·­Òë³öÀ´£¬¿ÉÊÇÓÉÓÚʱ¼äÔ­Òò£¬Ò²Ã»ÓÐÄǾ«Á¦£¬ËùÒÔÕâÀïÎһὫÎÒËù̽¾¿µÄÿ¸öPython/CǶÈ벿·Öº¯Êý¶¼ÓÃʵÀýÀ´ËµÃ÷£¬ÎÒÏë¿´´úÂë±ÈÎÒ½âÊÍҪͨË×Ò׶®¡£
ÔÙ˵helloworld֮ǰ£¬ÏȲ»µÃ²»ÌáÏÂǶÈëµÄÅäÖÃÎÊÌâ¡£
²½Ö裺
1£ºÇëµ½¹ÙÍøÏÂÔØpythonµÄ°²×°³ÌÐò£¬°²×°python£¨ÎÒÏëÕâ²½Óеã¶àÓ࣬²»¹ý»¹ÊÇдÉÏ°É£©
2£º½Ó×ÅÄã¿ÉÄÜ»¹ÐèÒªÏÂÔØpython£¨Óë°²×°°æ±¾Ïàͬ£©Ô´´úÂ룬ÒòΪÎÒÃÇÐèÒªÔÚdebugϱàÒëÁ´½ÓÉú³É¶ÔÓ¦µÄdebug¿â£¬ÈôÄãÄÜÔÚÍøÉÏÕÒµ½±ðÈËÒѾ­±àÒëºÃµÄ¿â£¬ÄãÒ²¿ÉÒÔÖ±½ÓÓñðÈ˵ġ£ÕâÑùµÃµ½2¸ödebug°æ±¾µÄ.libºÍ.dll
3£º½«pythonĿ¼ÏµÄincludeÎļþ¼ÐϵÄÎļþÒƵ½±àÒëϵͳµÄincludeÖУ¬È»ºó½«releaseºÍdebug°æ±¾µÄ.libºÍ.dll·Åµ½Ö¸¶¨µÄÎļþ¼ÐÖУ¨lib·Åµ½±àÒëϵͳlib£¬dll·Åµ½windows/system32/£©
4£ººÃÁË£¬ÅäÖþʹËÍê³ÉÁË¡£
À´¿´´úÂ룺
#include "python/python.h"  //ÎÒÊǽ«pythonÄÇЩͷÎļþ·ÅÔÚÎÒ×Ô¼º½¨µÄÃûΪpythonµÄÎļþ¼ÐÖÐ
int main(int argc,char** argv)
{
 Py_Initialize();//¸Ãº¯ÊýÆô¶¯python½âÊÍÆ÷£¬ËãÊdzõʼ»¯
////////////////////////
//ÔØÈëÎļþµÄ·½Ê½ÔËÐÐÖ¸Áî,FILEÊÇC±ê×¼¿âstdio.hÎļþÖеÄÒ»¸ö½á¹¹£¬Ï°¹ßCÓïÑÔµÄÓ¦¸ÃºÜÊìϤ£¨²»¹ýÎÒ»¹ÊǵÚÒ»´ÎʹÓ㬺¹...£©
 FILE * fr;
 fopen_s(&fr,"test.txt","r");
 PyRun_SimpleFile(fr,"test.txt");
 fclose(fr);
//Ö±½ÓÔËÐÐÖ¸ÁָÁÊÇ×Ö·û´®£¬×¢Òâ3.1.1°æµÄpython±ØÐë¼ÓÉÏСÀ¨ºÅ
 PyRun_SimpleString("print('Hello world,I am python!')");
///////////////////////
 Py_Finalize();   //¸Ãº¯Êý¹Ø±Õpython½âÊÍÆ÷£¬ËãÊÇɨβ
 return 0;
}
//¸½´øtest.txt
/*
from time import time,ctime
print('Today is', ctime(time()))
*/
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/xiadasong007/archive/2009/09/02/4511841.aspx
 PythonǶÈëC++Ïê½â(2)--Import Module
Ê×ÏÈ£¬ÎÒ²»µÃ²»Ìáµ½Ò»¸ö·Ç³£ºÃµÄÍøÕ¾£ºhttp://www.codase.com/index.html
ÕâÊÇÎÒÔÚ²éÕÒǶÈ뺯Êýʱ·¢Ïֵģ¬ÀïÃæÓзdz


Ïà¹ØÎĵµ£º

C/C++Êý×éÃûÓëÖ¸ÕëÇø±ðÉîÈë̽Ë÷(ת)

 ÒýÑÔ
¡¡¡¡Ö¸ÕëÊÇC/C++ÓïÑÔµÄÌØÉ«£¬¶øÊý×éÃûÓëÖ¸ÕëÓÐÌ«¶àµÄÏàËÆ£¬ÉõÖÁºÜ¶àʱºò£¬Êý×éÃû¿ÉÒÔ×÷ΪָÕëʹÓá£ÓÚÊǺõ£¬ºÜ¶à³ÌÐòÉè¼ÆÕ߾ͱ»¸ãºýÍ¿ÁË¡£¶øÐí¶àµÄ´óѧÀÏʦ£¬ËûÃÇÔÚCÓïÑԵĽÌѧ¹ý³ÌÖÐÒ²´íÎóµÃ¸øѧÉú½²½â£º"Êý×éÃû¾ÍÊÇÖ¸Õë"¡£ºÜÐÒÔË£¬ÎҵĴóѧÀÏʦ¾ÍÊÇÆäÖÐÖ®Ò»¡£Ê±ÖÁ½ñÈÕ£¬ÎÒÈÕ¸´Ò»ÈյؽøÐÐ×ÅC/C++ÏîÄ¿µÄ¿ª·¢£¬¶ ......

PythonÀ©Õ¹ºÍǶÈë

1.PythonµÄÀ©Õ¹
PythonÀ©Õ¹ÊÇÖ¸ÔËÓÃÆäËûÓïÑÔ±àдijЩ¹¦ÄÜÄ£¿é£¬¹©Python³ÌÐòµ÷Ó㬳£ÓõÄÓÐPythonµÄCÀ©Õ¹ºÍC++À©Õ¹¡£PythonÀ©Õ¹µÄÄ¿µÄÖ÷ÒªÓÐÁ½¸ö£ºÒ»ÊÇΪÁ˹¦ÄÜÐèÒª£¬ÁíÍâÒ»¸öÔ­ÒòÊÇΪÁËÐÔÄÜÐèÒª¡£ÏÂÃæ½éÉÜÒ»ÏÂÔÚ²»ÔËÓù¤¾ßµÄÇé¿öÏ£¬ÔËÓÃCºÍC++ÓïÑÔ¶ÔPython½øÐÐÀ©Õ¹µÄ²½Öè¡£
À©Õ¹µÄµÚÒ»²½ÊÇÓÃC»òC++´´½¨Ò»¸öÔ´³ÌÐò£¬È»ºó ......

¼¸ÖÖ³öÉ«µÄC/C++ GUIº¯Êý¿âµÄ½éÉÜ

 
QT
http://www.trolltech.com
http://www.qiliang.net/qt.html
QtÊÇTrolltech¹«Ë¾µÄÒ»¸ö¶àƽ̨µÄC++ͼÐÎÓû§½çÃæÓ¦ÓóÌÐò¿ò¼Ü¡£ËüÌṩ¸øÓ¦ÓóÌÐò¿ª·¢Õß½¨Á¢ÒÕÊõ¼¶µÄͼÐÎÓû§½çÃæËùÐèµÄËùÓù¦ÄÜ¡£QtÊÇÍêÈ«ÃæÏò¶ÔÏóµÄºÜÈÝÒ×À©Õ¹£¬²¢ÇÒÔÊÐíÕæÕýµØ×é¼þ±à³Ì¡£×Ô´Ó1996ÄêÔçЩʱºò£¬Qt½øÈëÉÌÒµÁìÓò£¬ËüÒѾ­³ÉΪȫÊÀ½ç·¶ ......

Python , Delphi , Loki ÓÐȤµÄÀ´Ô´

 Python , Delphi , Loki Èý¸öµ¥´ÊÓÐȤµÄÀ´Ô´
Ðí¶à³ÌÐòÉè¼ÆÓïÑԺͿª·¢¹¤¾ßÒÔ¼°¿âµÄÃû×Ö¶¼À´Ô´ÓëÉñ»°£¬ÆÄÓÐÒâ˼£º
     °¢²¨ÂÞÊÇͬʱ³öÏÖÔÚÏ£À°ºÍÂÞÂíÉñ»°ÖеİÂÁÖÅÁ˹ʮ¶þ´óÉñÖ®Ò»¡£Ëû³ýÁËÓµÓÐÌ«ÑôÉñµÄÉí·Ö£¬Í¬Ê±»¹ÓÐÔ¤ÑÔ¡¢ÒÕÊõ¡¢Ò½ÊõÖ®ÉñµÄ³ÆºÅ¡£°¢²¨ÂÞÊÇÖæ˹ºÍÀÖ¶äµÄ¶ù×Ó£¬ºÍ°¢µÙÃÛ˹ÊÇË ......

Python×°ÊÎÆ÷

Ô­ÎÄ£ºhttp://www.klipdas.com/blog/?p=python-decorator
python×°ÊÎÆ÷½éÉÜ
Python 2.2ÖÐÒýÈëµÄ classmethod() ºÍ staticmethod() ÄÚÖú¯Êý£¬Äã¿ÉÒÔÕâÑùµ÷ÓÃclassmethod()£º
class A:
def foo(self, y):
print y
foo = classmethod(foo)
Ò²¿ÉÒÔÕâÑù£º
class A:
@classmethod
def foo(sel ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ