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

pythonÈçºÎÉèÖÃCLOSE_WAIT״̬ռÓõĶ˿ÚÖØÓÃ

·¢ÏÖpython2.6
import httplib
conn=httplib.HTTPSConnection('x.x.x.x')
conn.request('','')
rd=conn.getresponse()
conn.close()
ÕâÑù½áÊøºó»á±ä³ÉCLOSE_WAIT״̬£¬ÎÒµÄÊÇ·þÎñ¶ËÖ÷¶¯¶Ï¿ªÁ¬½ÓµÄ£¬·¢ÏÖ¿Í»§¶ËÔÚconn.close()µÄʱºò²»»á·¢fin°ü£¬
ÎÒÔÚÍøÉÏËѹýһЩ½â¾ö°ì·¨£¬¸Ð¾õÕâ¸ö±È½ÏºÃ¾ÍÊǽ«CLOSE_WAIT״̬µÄ¶Ë¿ÚÔÙ·¢ÆðÐÂÁ´½ÓµÄʱºò»¹Ê¹ÓÃÕâ¸ö±»
CLOSE_WAITÕ¼ÓõĶ˿ڣ¬µ«ÊDz»Ì«Á˽âÈçºÎÉèÖÃpythonÔÚ·¢ÏÖij¸ö¶Ë¿ÚÊÇCLOSE_WAITµÄʱºò£¬²»×öеÄÁ¬½Ó£¬»¹Ê¹ÓÃÕâ¸ö¶Ë¿ÚÀ´Á¬½ÓÄÄ£¿£¿£¿Ð»Ð»¡£

Èç¹ûÓкð취½â¾öCLOSE_WAIT״̬µÄ»°Ò²Ï£ÍûÖ¸µãÖ¸µã£¡~~

{{


Ïà¹ØÎÊ´ð£º

pythonµÄÒýÓüÆÊý

ÎÒÓÃÁËdef CreateMyDialog(self):
        dlg = MyDialog(None, -1, ''.decode('utf8'), (300,300), (300,200), wx.DEFAULT_DIALOG_STYLE | wx.DIALOG_NO_PARENT )
&nbs ......

eric4ÔõôÔËÐÐpython³ÌÐò£¿

pythonºÍpyqtÒÔ¼°Eric4¶¼ÒѾ­ÅäÖúÃÁË£¬´ò¿ªEric4д¸öpython³ÌÐò±ÈÈç¼òµ¥µÄ
print¡°hello£¬world¡±£¬Ôõô±àÒëÔËÐÐÁË£¬Start²Ëµ¥µÄËùÓÐÃüÁ³öÏÖºÍͼÖв¶àµÄ¶Ô»°¿ò£¬Ó¦µ±ÔõôÔËÐÐÁË£¿

Çó´ó¼ÒÖ¸½Ì

ûÓÐÈËÓà ......

pythonÕýÔò±í´ïʽ ÈçºÎÈ¡³öÒÔÏÂ×Ö·û´® ¶àл

s='aaa111aaa,bbb222,333ccc,444ddd444,555eee666,fff777ggg'
ÓÃÕýÔò±í´ïʽȡ³ö Ç°ºó×ÖĸÏàͬµÄÊý¾Ý ½á¹ûÈçÏÂ:
111 ddd
лл~
Python code:

import re
s='aaa111aaa,bbb222,333ccc,444ddd444,555eee666,ff ......

ÓÐûÓз½±ãµÄpythonÔĶÁÆ÷ѽ£¿

¸Õ¿ªÊ¼ÓÃpython£¬
·¢ÏÖ´úÂëºÜÄÑÔĶÁ¡£

ÓдóÁ¿µÄ°üÊÇfrom½øÀ´µÄ£¬¸ã²»ÇåÊÇÄǸö°üµÄ¡£
sys.pathÖÐÓÖÓдóÁ¿Â·¾¶£¬ÕÒ²»µ½°üµÄλÖá£

ÔΣ¡
¿ÉÒÔ³¢ÊÔÒ»ÏÂeclipse, ÓÃpydev²å¼þ.

°´ÏÂctrl¼ü, È ......

python listÖÐÌí¼ÓÀà¶ÔÏóµÄÎÊÌâ

ÔÚlistÖÐÌí¼ÓÒ»¸öÀàµÄ¾Ö²¿±äÁ¿ ÕâÑù×öÊÇ·ñºÏ·¨ Çë¿´ÏÂÃæÀý×Ó:
Python code:

class A():
def __init__( self ):
self.__a = 0
self.__b = 'hello'
def get_a( self ):
ret ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ