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

[Python module] select

16.1. select — Waiting for I/O completion¶
This module provides access to the select and poll functions available in most operating systems, epoll available on Linux 2.5+ and kqueue available on most BSD. Note that on Windows, it only works for sockets; on other operating systems, it also works for other file types (in particular, on Unix, it works on pipes). It cannot be used on regular files to determine whether a file has grown since it was last read.
The module defines the following:
Õâ¸öÄ£¿éÌṩ´ó¶àÊý²Ù×÷ϵͳµÄselectºÍpoll¹¦ÄÜ¡£ epollÔÚLinux2.5+¿ÉÓã¬kqueueÔòÓÃÓÚBSD¡£ÔÚwinodwsϵͳÉÏ£¬Ëü½öÓÃÓÚsocket£¬ÔÚÆäËûϵͳÏ£¬ËüÒ²¿ÉÒÔÓÃÓÚÆäËûÀàÐÍ£¨ÌرðÔÚ Unix Ï£¬Ëü»¹¿ÉÒÔÓÃÓÚ ¹ÜµÀ£©¡£Ëü²»ÄÜÓÃÀ´È·¶¨×Ô´ÓÉϴζÁÈ¡ÒÔºóÊÇ·ñÆÕͨÎļþÓÐËùÔö³¤¡£
exception select. error ¶ The exception raised when an error occurs. The accompanying value is a pair containing the numeric error code from errno and the corresponding string, as would be printed by the C function perror .
ÔÚ·¢Éú´íÎó½«Òý·¢Òì³£¡£accompanying Öµ°üº¬´íÎó´úÂëºÍ´íÎóÃèÊöÎı¾£¬ÓÃÓÚʹÓà C ³ÌÐò perror() ´òÓ¡¡£
select. epoll ( [ sizehint=-1 ] ) ¶ (Only supported on Linux 2.5.44 and newer.) Returns an edge polling object, which can be used as Edge or Level Triggered interface for I/O events; see section Edge and Level Trigger Polling (epoll) Objects below for the methods supported by epolling objects.
½ö½öÔÚLinux2.5.44ÒÔÉÏÖ§³Ö¡£
select. poll ( ) ¶ (Not supported by all operating systems.) Returns a polling object, which supports registering and unregistering file descriptors, and then polling them for I/O events; see section Polling Objects below for the methods supported by polling objects.
ËùÓÐϵͳ²»Ö§³Ö¡£
select. kqueue ( ) ¶ (Only supported on BSD.) Returns a kernel queue object object; see section Kqueue Objects below for the methods supported by kqueue objects.
½ö½öÖ§³ÖBSD¡£
select. kevent ( ident , filter=KQ_FILTER_READ , flags=KQ_ADD , fflags=0 , data=0 , udata=0 ) ¶ (Only suppor


Ïà¹ØÎĵµ£º

PythonÍøÂç×¥°ü¿â pypcap

Ethereal ×Ô´øÐí¶àЭÒéµÄ decoder,¼òµ¥,Ò×ÓÃ,»ùÓÚwinpcapµÄÒ»¸ö¿ªÔ´µÄÈí¼þ.µ«ÊÇËüµÄ¼Ü¹¹²¢²»Áé»î,ÈçºÎÄãÒª¼ÓÈëÒ»¸ö×Ô¼º¶¨ÒåµÄµÄ½âÂëÆ÷,µÃÈ¥ÐÞ¸Ä EtherealµÄ´úÂë,ÔÙÖØÐ±àÒë,ºÜ·³Ëö.¶ÔÓÚÒ»°ãµÄÃ÷ÎÄ Ð­Òé,ûÓÐʲôÎÊÌâ,µ«ÊǶÔÓÚ¼ÓÃÜЭÒé,±ÈÈçÍøÂçÓÎÏ·,¿Í»§¶Ë³ÌÐòÒ»°ã»áÔÚ¸ÕÁ¬½ÓÉϵÄʱºò,·¢ËÍÒ»¸öËæ»úÃÜÔ¿,¶øºóµÄ±¨Îͼ»áÓÃÕ⸠......

PYTHON½Ì³Ì [Symbian]

Ò»¡¢pythonÊÇʲô£¿
Æäʵ£¬python¾ÍÊÇÒ»Ãűà³ÌÓïÑÔ£¬¾ÍÏñjavaÒ»Ñù¡£±¾À´ÊÇÔÚµçÄÔÉϵ쬵«ÊÇËæ×ÅÊÖ»úµÄÁ÷ÐУ¬python±»ÒÆÖ²µ½ÁËÊÖ»úÉÏ£¬Í¬Ê±Ò²±»ÃüÃûΪpyS60¡£
¶þ¡¢pyÈí¼þµÄ¹¹Ôì
ËùÓеÄpyÈí¼þ¶¼Òª°üÀ¨ÈçÏÂÎļþ£º.app--1.65k£».rsc--337b£».aif¡£ÕâÈý¸öÎļþÔÚËùÓÐpyÈí¼þÖж¼ÊÇÏàͬµÄ£¬Î¨Ò»µÄÇø±ð¾ÍÊÇÈí¼þµÄuid²»Í¬¡£ÕâЩÎļ ......

PythonÐÔÄܲâÊÔº¯Êý

Python ÉçÇøÓоäË×Ó“Python ×Ô¼º´ø×Åµç³Ø¡£” ±ð×Ô¼ºÐ´¼ÆÊ±¿ò¼Ü¡£Python 2.3ÒÔºó ¡¢¾ß±¸Ò»¸ö½Ð×ö timeit µÄÍêÃÀ¼ÆÊ±¹¤¾ß¡£DiveIntoÖеÄÀý×Ó
>>> import timeit
>>> t = timeit.Timer("soundex.soundex('Pilgrim')",
... "import soundex")
>>> t.timeit() ......

Python¿ìËÙÈëÃÅ

1. µÚÒ»Õ¡¡Python¿ìËÙÈëÃÅ
±¾ÕÂÊÇPythonµÄ¿ìËÙÈëÃÅ£¬ÔÚÕâÒ»Õ²¢²»Éæ¼°pythonµÄÌØÊâ¹æÔòºÍϸ½Ú£¬Ä¿±êÊÇͨ¹ýʾÀýʹÄã¿ìËÙÁ˽âPythonÓïÑÔµÄÌØµã¡£±¾Õ¼òÒª½éÉÜÁ˱äÁ¿,±í´ïʽ,¿ØÖÆÁ÷,º¯ÊýÒÔ¼°ÊäÈë/Êä³öµÄ»ù±¾¸ÅÄî,ÔÚÕâÒ»Õ²»Éæ¼°PythonÓïÑԵĸ߼¶ÌØÐÔ¡£¾¡¹ÜÈç´Ë£¬Óо­ÑéµÄ³ÌÐòÔ±»¹ÊÇÄܹ»Í¨¹ýÔĶÁ±¾ÕµIJÄÁÏ´´½¨¸ß¼¶³ÌÐò¡£ÎÒÃÇ ......

LinuxÏÂÓÃPYTHON²éÕÒͬÃû½ø³Ì

1.¿ÉÖ´ÐгÌÐò
os.system('pgrep %s > %s' % (process, output))
   pidfile = open("output", 'r')
   totalpid = len(pidfile.readlines())
   pidfile.close()
   if totalpid == 0 :
         &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ