ѧϰ¡¶PythonÓïÑÔÈëÃÅ¡·µÚËÄÕ º¯Êý
ÔõôÕÒ²»µ½µÚÈýÕµÄѧϰ±Ê¼ÇÁË£¿¶ªÁË£¿
PythonµÄº¯ÊýûÓÐʲôµÄ£¬¿ÉÒÔ˵£¬¿´ÁË¡¶¼òÃ÷Python½Ì³Ì¡·ºó£¬¾Í»áдÁË¡£
ÕâÒ»ÕÂÌṩµÄÄÚÈÝÒ²±È¡¶¼òÃ÷Python½Ì³Ì¡·Òª¶àһЩ¡£±È½Ï¸´ÔÓµÄÊÇ×÷ÓÃÓò¹æÔò£¬²»ÖªµÀÊÇÊéû½²Çå³þ»¹ÊÇ·ÒëµÃ²»ºÃ£¬±È½ÏÄѶ®¡£Ç®Äܵġ¶C++³ÌÐò½Ì³Ì¡·¹ØÓÚº¯ÊýµÄ×÷ÓÃÓò¹æÔò½²µÃÒªÇå³þЩ£¬ÓÐC++µÄ֪ʶÔÚÀïÃ棬Àí½âPythonµÄº¯Êý×÷ÓÃÓò¹æÔò£¬ºÃ¶®ºÜ¶à¡£ËƺõÁ½ÕßҲûÓÐʲôÇø±ð¡£
º¯Êý²ÎÊý·½ÃæÓÐЩ²»Ò»Ñù£¬C++µÄÖµ´«µÝ¡¢Ö¸Õë´«µÝ¡¢ÒýÓô«µÝ·ÖµÃºÜÇå³þ¡£¶øPythonµÄ²ÎÊý´«µÝÓÐЩ²»Äܸıä²ÎÊýµÄÖµ£¬ÓÐЩÊÇ¿ÉÒԵġ£ÐèҪСÐĵĶԸ¶¡£»¹Óйؼü×ֵIJÎÊý¡¢¿É±ä²ÎÊý£¬¶¼ÊÇC++ûÓеÄÄÚÈÝ¡£PythonµÄº¯Êý¿ÉÒÔ²»ÓÃreturn£¬µ«ÊǺóÃæµÄÉè¼Æ¸ÅÄÊǽ¨ÒéÒªÓÃreturn·µ»Ø¡£
lambda¡¢map¡¢applyÕâЩ¹¤¾ßºÜ·½±ã£¬Óнű¾µÄÓ°×ÓÔÚÀïÃæ¡£
×îÈÃÎÒ¾ªÆæµÄÊÇ“º¯ÊýÊǶÔÏó: ·ÇÖ±½Óµ÷ÓÔÕâһС½Ú¡£PythonÖк¯ÊýµÄÁé»îÊÇC++Ëù²»¿É±ÈµÄ¡£PythonµÄº¯Êý¾ÍÏñһСÍÅÕ³ÍÁÒ»Ñù£¬¿ÉÒÔÈà¹ýÀ´´ê¹ýÈ¥µÄʹÓá£
“º¯Êý³£¼ûµÄÎÊÌâ”ȷʵÈÃÎÒÕâ¸öÐÂÊÖÃÔºýÁË£¬ÔÝʱÏȲ»ÌáËüÃÇ°É¡£¶øÇÒÕâÒ»½ÚÀïÃæµÄÀý×ÓËƺõÓÐÎÊÌ⣬ÓÐһЩÊéÉÏ˵²»ÄÜÔËÐУ¬µ«ÔÚÎÒµÄPythonÖÐÈ´ÄÜÔËÐУ»ÁíÓÐһЩ˵ÄÜÔËÐУ¬µ«ÎÒÔËÐгö´í¡£ÊDz»ÊÇPythonµÄ°æ±¾¸üµü¸Ä±äÁËһЩ¶«Î÷£¿ÕâÒ»½ÚµÄÄÚÈÝ»¹ÊÊÓÃÂð£¿
Ïà¹ØÎĵµ£º
µÚ¾Å¹Ø Image
´ÓÒ³ÃæÉϵÄͼƬ¿ÉÒÔ¿´µ½ÓÐÒ»´®µã£¬ÄÇôÊDz»ÊÇ´ú±í¸Ã¹ØÓëͼÏñµãÓйأ¿ ÎÒÃÇ´ÓÒ³ÃæÔ´Âë¿ÉÒÔ¿´µ½£¬ÓÐÁ½¶ÎÊý×ÖÐòÁÐfirstºÍsecond£¬¶øÓÐÒ»¸öÌáʾfirst+second=? ʲôÒâ˼ÄØ£¿ÄѵÀÊÇ˵(first, second)´ú±íÁËͼÏñµãµÄ×ø±ê£¿²»Ïñ£¬Á½¶ÎÐòÁеij¤¶ÈÓкܴó²îÒì¡£ÄÇôËã·û+»¹ÓÐʲôº¬ÒåÄØ£¬Óп ......
˵ʵ»°£¬PythonÕæµÄ²»Ì«ÊʺÏ×öÕâÖÖ¶þ½øÖƵĶ«Î÷£¬ÌìÉúûÓÐÖ¸Õ룬µ¼ÖÂÔÚC/C++ºÜÈÝÒ׵Ķ«Î÷ÔÚPythonϾͺÜÂé·³¡£²»¹ýºÃÏñ3.1ÓÐÁËÔÉúµÄbytesÀàÐÍ£¬²»ÖªµÀÄܲ»ÄܸıäÏÖ×´¡£
import sys
import time
import socket
import struct
import random
def SendPacketData (Buffer = None , DestIP = "127.0.0.1" , DestPort = 0 ......
´úÂëÖвÉÓÃÁËÈý²½ÊµÏÖËãÊõ±í´ïʽµÄ½âÎö:
1. ½«ËãÊõ±í´ïʽ(×Ö·û´®)ת»»³ÉÒ»¸öÁбíparseElement·½·¨
2. ½«Áбí±íʾµÄËãÊõ±í´ïʽת»»³Éºó׺±í´ïʽchangeToSuffix
3. ¼ÆËãºó׺±í´ïʽµÄ½á¹û
ÕâÀïÎÒÊÇΪÁË·½±ã, ¾ÍдÁ˸öparseElement, ²»ÏëÄÇ·½·¨Ð´µ½ºóÃæÈ´°Ñ×Ô¼ºÈÆסÁË, ¿ÉÒÔÏëÏóÒ»¸ö´ø×ÔÔö, λ, Âß¼, ËãÊõµÄ±í´ïʽµÄÊýÖµÌá ......
1. ʼþÇý¶¯
Ò»¸öʼþ¼°Æä»Øµ÷µÄÀý×ÓÊÇÊó±êÒƶ¯¡£ÎÒÃǼÙÉèÊó±êÖ¸ÕëÍ£ÔÚÄúGUI ³ÌÐòµÄij´¦¡£Èç¹ûÊó±ê±»ÒƵ½Á˳ÌÐòµÄ±ð´¦£¬Ò»¶¨ÊÇÓÐʲô¶«Î÷ÒýÆðÁËÆÁÄ»ÉÏÖ¸ÕëµÄÒƶ¯£¬´Ó¶ø±íÏÖÕâÖÖλÖõÄתÒÆ¡£ÏµÍ³±ØÐë´¦ÀíÕâЩÊó±êÒƶ¯Ê¼þ²ÅÄÜÕ¹ÏÖ£¨²¢ÊµÏÖ£©Êó±êÔÚ´°¿ÚÉϵÄÒƶ¯¡£Ò»µ©ÄúÊÍ·ÅÁËÊó±ê£¬¾Í²»ÔÙ»áÓÐʼþÐèÒª´¦ ......
×òÌìÊÔÁËÏÂÓÃHTMLParserÀàÀ´½âÎöÍøÒ³£¬¿É·¢ÏÖ½á¹û²¢²»ÀíÏë¡£²»¹ÜÔõô˵£¬ÏÈдϹý³Ì£¬Ï£ÍûºóÀ´ÈËÄÜÔÚ´Ë»ù´¡ÉϽâ¾öÎÒËùÓöµ½µÄÎÊÌâ¡£
дÁË2Ì×½â¾ö·½°¸£¬µ±È»Õâ2Ì×Ö»ÄܶÔÌض¨ÍøÕ¾ÓÐЧ¡£ÎÒÕâÀïÖ÷Ҫ˵Ã÷϶ÔBBCÖ÷Ò³www.bbc.co.ukºÍ¶ÔÍøÒ×www.163.comµÄ½âÎö¡£
¶ÔÓÚBBC£º
ÕâÌ×Òª¼òµ¥µÃ¶à£¬¿ÉÄÜÊǸÃÍøÒ³µÄ±àÂë±È½Ï±ê×¼°É
import ......