Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : Python

CÄÚǶpythonµÄÎÊÌâ

ÏëÓÃpython½âÎöÒ»¸ö´øÖÐÎĵÄxmlÎļþ£¬È»ºó°Ñ½âÎöµÃµ½µÄÊý¾ÝÒÔlistµÄÐÎʽ·µ»Ø¸øC´úÂë¡£

rel = PyObject_CallObject(func, NULL);//µ÷ÓÃpython½âÎöxml
PyList_GetItem(rel,i)£»//µÃµ½listÖеÄÿһÏî
PyString_AsString£¨£©£»//ת»¯³ÉC×Ö·û´®

µ«ÊÇÿ´Îµ÷ÓÃPyList_GetItemµÃµ½°üº¬ÖÐÎĵÄ×Ö·û´®Ê±£¬¾Í»á³öÏÖ ......

luaǶÈëCÖеÄÁ¢¼´Ö´ÐÐÀàËÆpythonµÄPyRun_SimpleString

python capiÊÇÕâÑùµÄPyRun_SimpleString
lua µÄÔõôдÄØ£¿
Python code:
luaL_dostring
......

python Òì³£Í˳ö

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

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

python.exeÓöµ½ÎÊÌâÐèÒª¹Ø±Õ¡£ÎÒÃǶԴËÒýÆðµÄ²»±ã±íʾ±§Ç¸¡£
Èç¹ûÄúÕý´¦ÓÚ½ø³Ìµ±ÖУ¬ÐÅÏ¢ÓпÉÄܶªÊ§¡£
¶ÔÓÚ´Ë´íÎóµÄÆäËûÐÅÏ¢£¬  Çëµ¥»÷´Ë´¦¡£

µ÷ ......

python ÈÕÖ¾ÎÊÌâ


ÎÒÔËÐÐһϳÌÐò£º
import logging

def initlog():

    logger = logging.getLogger()
    hdlr = logging.FileHandler('D:\log_fram.log')
    formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
    hdlr. ......

python»·¾³±äÁ¿ÎÊÌâ

ÎÒ°Ñpython°²×°µ½ÁËC:\Python25
È»ºóÔÚWindows 7ϵͳ±äÁ¿µÄpathÖÐÌí¼ÓÁË C:\Python25;
È»ºóÖØÆôµçÄÔ
È»ºóÔÚcmdÖмüÈëpython»òPython¶¼ÎÞЧ¡£

ÕâÊÇΪʲô£¿
Windows 7»¹Ã»Óùý£¬

Äã¾ÍÖ±½ÓÓà IDLE °É

ÏÈÖ´ÐÐ path£¬¿´¿´ÊDz»ÊǶԵÄ

Windows 7  »¹Ã»ÓÃŶ
pathûÎÊÌâµÄ»° ¾Í¿´¿´ÊDz»ÊÇÆäË ......

pythonÖÐÏß³ÌÎÊÌ⣿£¿

ÎÒÏÖÔÚÊÇÕâÑùµÄ
¿ªÁËÒ»¸ö×ÓỊ̈߳¬¶ÁÈ¡ÏÂÃæµÄÏûÏ¢
±¾ÒâÊÇ
Python code:

while not self._stopevent.isSet( ):
re=¶ÁȡϲãÏûÏ¢
if re>0:
´¦Àí
else:
pass

¼ÙÈçre¶¼ <0,²»ÖªµÀΪºÎ½çÃæ»áËÀ£¬ºÜÆæ¹Ö£¬Ã÷Ã÷¾ÍÊÇ×ÓÏß³ÌÖС£
¸ü»¬»üµÄ£¬Èç¹ûpass±ä³Éprint "1&qu ......
×ܼǼÊý:175; ×ÜÒ³Êý:30; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [21] [22] [23] [24] [25] [26] [27] [28] 29 [30]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ