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

[Python module] threading

threading — Higher-level threading interface
This module constructs higher-level threading interfaces on top of the lower level _thread module. See also the queue module.
The dummy_threading module is provided for situations where threading cannot be used because _thread is missing.
 
Õâ¸öÄ£¿éÊǹ¹½¨Ôڵײã_threadÄ£¿éÉϵġ£
dummy_threadingÄ£¿éÌṩÁË¿Éthreading£¨ÓÉÓÚ_threadȱʧ£©Ä£¿é²»ÄÜʹÓõÄÇé¿ö¡£
 
Note
While they are not listed below, the camelCase names used for some methods and functions in this module in the Python 2.x series are still supported by this module.
This module defines the following functions and objects:
threading.active_count() Return the number of Thread objects currently alive. The returned count is equal to the length of the list returned by enumerate().
threading.Condition() A factory function that returns a new condition variable object. A condition variable allows one or more threads to wait until they are notified by another thread.threading.current_thread() Return the current Thread object, corresponding to the caller’s thread of control. If the caller’s thread of control was not created through the threading module, a dummy thread object with limited functionality is returned.threading.enumerate() Return a list of all Thread objects currently alive. The list includes daemonic threads, dummy thread objects created by current_thread(), and the main thread. It excludes terminated threads and threads that have not yet been started.threading.Event() A factory function that returns a new event object. An event manages a flag that can be set to true with the set() method and reset to false with the clear() method. The wait() method blocks until the flag is true.class threading.local
A class that represents thread-local data. Thread-local data are data whose values are thread specific. To manage thread-local data, just create an instance of local (or a subclass) and store attributes on it:
mydata = threadi


Ïà¹ØÎĵµ£º

ʹÓà Notepad++ ±à¼­ÔËÐÐ Python ³ÌÐò


Posted on 18:40:00 by ÏþÔÂ and filed under Notepad++, Python
¡¡¡¡Notepad++ ÊÇÒ»¸ö¿ªÔ´µÄÎı¾±à¼­Æ÷£¬¹¦ÄÜÇ¿´ó¶øÇÒʹÓ÷½±ã¡£±à¼­ºÍµ÷ÊÔ Python ³ÌÐòʹÓÃʲô±à¼­Æ÷»òÕß IDE ²»Í¬ÈËÓв»Í¬¼û½â¡£ÔÚ²»¿¼ÂÇʹÓõ÷ÊÔ¹¤¾ßµÄÇé¿öÏ£¬Vim »òÕß Emacs Óû§×ÔÈ»¿ÉÒÔÎÞÊÓÆäËû±à¼­Æ÷£¬²»¹ýÔÚ Windows »·¾³Ï£¬Ê¹Óà Notepad++ Ö ......

pythonÕýÔò±í´ïʽѧϰ


python ÖеÄre Ä£¿é
ÕýÔò±í´ïʽ
¾Í¸öÈ˶øÑÔ£¬Ö÷ÒªÓÃËüÀ´×öһЩ¸´ÔÓ×Ö·û´®·ÖÎö£¬ÌáÈ¡ÏëÒªµÄÐÅÏ¢
ѧϰԭÔò£º¹»ÓþÍÐУ¬ÐèÒªµÄʱºòÔÚÉîÈë
ÏÖ×ܽáÈçÏ£º
ÕýÔò±í´ïʽÖÐÌØÊâµÄ·ûºÅ£º
“.” ±íÈÎÒâ×Ö·û
“^ ” ±ístringÆðʼ
“$” ±ístring ½áÊø
“*” “+” & ......

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

1.¿ÉÖ´ÐгÌÐò
os.system('pgrep %s > %s' % (process, output))
   pidfile = open("output", 'r')
   totalpid = len(pidfile.readlines())
   pidfile.close()
   if totalpid == 0 :
         &nbs ......

Python: pythonдµÄÒ»¸ö¼òµ¥ÍøÂç´Êµä

ÏÐÀ´ÎÞÊÂ, ÍæÍæpython...
ÊDzÉÓÃÓеÀ·­Òë, È»ºó×¥È¡ÍøÒ³µÄ.
import re, urllib
url="http://dict.youdao.com/search?le=eng&q="
print ("input q to exit")
while 1:
word = raw_input(">>>")
if word=="q":
exit()
else:
word = word.replace(' ', '+')
url += word
u ......

[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 al ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ