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

¼ò»¯Python½âÊÍ»·¾³µÄ°²×°

ÎÊÌâÃèÊö
ÔÚC++ºÍPython»ìºÏ±à³ÌÖУ¬ÔÚÈí¼þ·¢²¼µÄʱºòÐèÒª½«pythonµÄ½âÊÍÆ÷´ò°üµ½°²×°³ÌÐòÖУ¬ÎªÁËÌá¸ßÓû§ÌåÑ飬ÎÒÃÇÐèÒªÈÃÓû§¸Ð¾õ²»µ½pythonµÄ°²×°£¬Èç¹ûÓû§ÒѾ­°²×°ÓÐpythonµÄ»·¾³£¬ÎÒÃÇÒ²Òª±£Ö¤²»Ó°ÏìÏÖÓеÄϵͳ¡£
½â¾ö·½°¸
ÔÚPython2.5ÒÔºó£¬pythonÖ§³Ö´ÓzipÎļþÖжÁÈ¡python½Å±¾Îļþ£¬Ö§³Ö¶ÁÈ¡py£¬pyc£¬pyo£¬²»Ö§³Ö¶ÁÈ¡pyd£¬Òò´Ë
ÎÒÃÇ¿ÉÒÔ½«pythonµÄ±ê×¼¿â±àÒëÒÔºó´ò°üµ½Ò»¸özipÎļþÖУ¬ÔÚC++Öе÷ÓÃpython½Å±¾µÄʱºò£¬½«zipÎļþ¼ÓÈëµ½sys.pathµÄËÑË÷·¾¶ÖÐÀ´Íê³É¡£
½«pythonµÄ±ê×¼¿âµÄ½Å±¾ÎļþĿ¼C:\Python25\LibÖеĽű¾Îļþcopyµ½Ò»¸öÖ¸¶¨µÄĿ¼£¬È»ºóÎÒÃÇɾ³ýµôһЩ²»ÓõĿâÎļþ±ÈÈçmsilib£¬complierµÈ£¨´Ë²½²»ÊìϤ¿ÉÒÔ²»ÒªÊ¡È¥É¾³ý¶àÓàÎļþ£©¡£
½«½Å±¾±àÒëΪÓÅ»¯ºóµÄÎļþ python -O -m compileall destdir£¬È»ºóɾ³ýËùÓÐÈßÓàµÄpyºÍpyc£¬ del /S /Q "%1\*.pyc" "%1\*.py " ( %1 ±íʾĿ±êÎļþ¼Ð )
½«ÎļþѹËõ³Ézip¸ñʽ "%WINRAR_DIR%\WinRar" a -r -m5 -tk "python25.zip"  "*"
ÎÒÃÇ×Ô¼ºµÄpyÎļþ¿ÉÒÔ°´ÕÕͬÑùµÄ·½·¨Ñ¹Ëõµ½src.zipÖÐ
½«pythonµÄpydÎļþ(WindowsĬÈÏÊÇC:\Python25\DLLs)¸´ÖƵ½Ä¿±êÎļþ¼Ðpython25_dllÖÐ
½«python25.dll¸´ÖƵ½Ó¦ÓóÌÐòµÄËÑË÷·¾¶ÖÐ
ÔÚC++Öе÷ÓÃPythonµÄC APIÉèÖÃpython¿âµÄËÑË÷·¾¶£¬ÕâÑùÎÒÃǾͿÉÒԾͿÉÒÔͨ¹ýPython C API½øÐлìºÏÓïÑԵıà³Ì£¬ÔÚ²¿ÊðµÄʱºò²»ÐèÒªµ¥¶À°´ÕÕpython°²×°³ÌÐò
    char buffer[1024] = { 0 };
    Py_Initialize();
    PyRun_SimpleString( "import sys" );
    //»ñÈ¡µ±Ç°Â·¾¶,Èç¹ûÊÇGUI³ÌÐòÓпÉÄÜ»á¸Ä±ä³ÌÐòµÄµ±Ç°¹¤×÷Ŀ¼£¬Èç¹ûÊÇ·þÎñÆ÷
    //³ÌÐòÒ»°ãµ±Ç°µÄ¹¤×÷Ŀ¼¾ÍÊǶþ½øÖÆÎļþËùÔÚµÄĿ¼
#ifdef WIN32
    char achCwdBuf[PATH_MAX] = {0};
    if( NULL != GetModuleFileName(NULL, achCwdBuf, PATH_MAX) )
#else
    if( NULL != ACE_OS::getcwd(achCwdBuf, PATH_MAX) )
#endif // end of ifdef WIN32
    {       
        string strCwd = achCwdBuf;
        strCwd = strCwd.substr( 0, strCwd.find_last_of(


Ïà¹ØÎĵµ£º

python²Ù×÷excel


¼ÈȻѡÔñÁËÔ¶·½£¬¾Í±ØÐëÈÕÒ¹¼æ³Ì http://wrsuifeng.javaeye.com
Python´úÂë
# Filename: excel.py   
import os,sys,time   
import win32com.client   
import traceback   
  
excel = win32com.client.Dispatch(" ......

python Excel ±à³Ì

1)Excel hyperlink:
xlsApp = win32com.client.Dispatch('Excel.Application')
cell = xls.App.ActiveSheet.Cells(1,1)
cell.Hyperlink.Add(cell,'http://xxx')
2)Excel row/column count:
sht = xlsApp.ActiveSheet
sht.Columns.Areas.Count
sht.Rows.Areas.Count
*************************
£Û1£ÝʹÓÃPyExcelera ......

PythonÖеÄһЩÒì³£

ÆäʵÒì³£¾ÍÊDz»Õý³££¬¾ÍÊDz»ºÍÎÒÃÇÏëÏóÒ»ÑùÈ¥Ö´ÐС£ËüÊÇÒòΪ³ÌÐò³öÏÖÁË´íÎó¶øÔÚÕý³£¿ØÖÆÁ÷ÒÔÍâ²ÉÈ¡µÄÐÐΪ¡£Python³öÏÖÒì³££¬¾ÍÊÇÒòΪ¼ì²éÁËÒ»¸ö´íÎóʱ£¬Python½âÊÍÆ÷ÎÞ·¨¼ÌÐø¼ÌÐøÖ´ÐÐÏÂÈ¥£¬ÕâʱºòÅ׳öÁËÒì³£¡£ÍùÍùÕâ¸ö´íÎó·ÖΪÓï·¨ÉϺÍÂß¼­ÉÏ(²»Éó¤Ëµ¸ÅÄ-_-! )£¬¿´¿´¼¸¸öÀý×Ó£¬×ܽáһϣº
1¡¢NameError£º³¢ÊÔ·ÃÎÊÒ»¸öÎ ......

Èà easy_install ʹÓôúÀí·­Ç½°²×° Python Ä£¿é

ÀµÓºƣ¨http://laiyonghao.com£©
¹Ø¼ü×Ö£ºpython, easy_install, setuptools, myentunnel, polipo, windows, linux, socks5, http, proxy
ÒòΪһЩÖÚËùÖÜÖªµÄÔ­Òò£¬ÎÒÃÇÓÐЩÍøÕ¾ÎÞ·¨·ÃÎÊ£¬Ôì³ÉÉú»îºÍÉú²úµÄ¾Þ´ó²»±ã¡£ÆäÖжÔÎÒÓ°Ïì±È½Ï´óµÄÒ»¸ö¾ÍÊÇ°²×°Ä³Ð© Python Ä£¿éµÄʱºò£¬easy_install ÎÞ·¨·ÃÎʵ½ÍøÕ¾¡£ÔÚÕâÀï·ÖÏíÈ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ