锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美黄色精品,欧美喷潮久久久xxxxx,久久综合色播五月http://m.shnenglu.com/riverbird/category/5866.html蹇嗗線鏄?
欏圭窘涓嶈繃姹?
姹熶笢濂介鍏?
浠婃尟鑷備竴鍛?鐜囩敳涓夊崈,
璇曢棶澶?
zh-cnWed, 21 May 2008 18:41:17 GMTWed, 21 May 2008 18:41:17 GMT60python妯″潡涔媡hreading: 鍦╬ython涓嬌鐢ㄥ綰跨▼http://m.shnenglu.com/riverbird/archive/2007/12/26/39704.html姹熻竟涔嬮笩姹熻竟涔嬮笩Wed, 26 Dec 2007 10:04:00 GMThttp://m.shnenglu.com/riverbird/archive/2007/12/26/39704.htmlhttp://m.shnenglu.com/riverbird/comments/39704.htmlhttp://m.shnenglu.com/riverbird/archive/2007/12/26/39704.html#Feedback1http://m.shnenglu.com/riverbird/comments/commentRss/39704.htmlhttp://m.shnenglu.com/riverbird/services/trackbacks/39704.html
threading妯″潡閲岄潰涓昏鏄涓浜涚嚎紼嬬殑鎿嶄綔瀵硅薄鍖栦簡錛屽垱寤轟簡鍙玊hread鐨刢lass銆備竴鑸潵璇達(dá)紝浣跨敤綰跨▼鏈変袱縐嶆ā寮忥紝涓縐嶆槸鍒涘緩綰跨▼瑕佹墽琛岀殑
鍑芥暟錛屾妸榪欎釜鍑芥暟浼犻掕繘Thread瀵硅薄閲岋紝璁╁畠鏉ユ墽琛岋紱鍙︿竴縐嶆槸鐩存帴浠嶵hread緇ф壙錛屽垱寤轟竴涓柊鐨刢lass錛屾妸綰跨▼鎵ц鐨勪唬鐮佹斁鍒拌繖涓柊鐨?
class閲屻傛垜浠潵鐪嬬湅榪欎袱縐嶅仛娉曞惂銆?br>
#-*- encoding: gb2312 -*- import string, threading, time
def thread_main(a): global count, mutex # 鑾峰緱綰跨▼鍚?/span> threadname = threading.currentThread().getName()
for x in xrange(0, int(a)): # 鍙栧緱閿?/span> mutex.acquire() count = count +1 # 閲婃斁閿?/span> mutex.release() print threadname, x, count time.sleep(1)
def main(num): global count, mutex threads = []
count =1 # 鍒涘緩涓涓攣 mutex = threading.Lock() # 鍏堝垱寤虹嚎紼嬪璞?/span> for x in xrange(0, num): threads.append(threading.Thread(target=thread_main, args=(10,))) # 鍚姩鎵鏈夌嚎紼?/span> for t in threads: t.start() # 涓葷嚎紼嬩腑絳夊緟鎵鏈夊瓙綰跨▼閫鍑?/span> for t in threads: t.join()
if__name__=='__main__': num =4 # 鍒涘緩4涓嚎紼?/span> main(4)
#-*- encoding: gb2312 -*- import threading import time
class Test(threading.Thread): def__init__(self, num): threading.Thread.__init__(self) self._run_num = num
def run(self): global count, mutex threadname = threading.currentThread().getName()
for x in xrange(0, int(self._run_num)): mutex.acquire() count = count +1 mutex.release() print threadname, x, count time.sleep(1)
if__name__=='__main__': global count, mutex threads = [] num =4 count =1 # 鍒涘緩閿?/span> mutex = threading.Lock() # 鍒涘緩綰跨▼瀵硅薄 for x in xrange(0, num): threads.append(Test(10)) # 鍚姩綰跨▼ for t in threads: t.start() # 絳夊緟瀛愮嚎紼嬬粨鏉?/span> for t in threads: t.join()
C:\>test1.py
Usage: 'test1.py [options] install|update|remove|start [...]|stop|restart [...]|
debug [...]'
Options for 'install' and 'update' commands only:
--username domain\username : The Username the service is to run under
--password password : The password for the username
--startup [manual|auto|disabled] : How the service starts, default = manual
--interactive : Allow the service to interact with the desktop.
C:\>
瀹夎鎴戜滑鐨勬湇鍔?
[code:1:05b7353f1c]C:\>test1.py install
Installing service test_python to Python class C:\test1.test1
Service installed
D:\>e2.py -v
Trying:
myadd(1, 2)
Expecting:
3
ok
Trying:
myadd(4, 5)
Expecting:
9
ok
1 items had no tests:
__main__
1 items passed all tests:
2 tests in __main__.myadd
2 tests in 2 items.
2 passed and 0 failed.
Test passed.
]]>鍙戠幇涓涓敤浜巜indows涓婫UI鑷姩鍖栨祴璇曠殑涓滀笢http://m.shnenglu.com/riverbird/archive/2007/12/24/39480.html姹熻竟涔嬮笩姹熻竟涔嬮笩Mon, 24 Dec 2007 02:43:00 GMThttp://m.shnenglu.com/riverbird/archive/2007/12/24/39480.htmlhttp://m.shnenglu.com/riverbird/comments/39480.htmlhttp://m.shnenglu.com/riverbird/archive/2007/12/24/39480.html#Feedback0http://m.shnenglu.com/riverbird/comments/commentRss/39480.htmlhttp://m.shnenglu.com/riverbird/services/trackbacks/39480.html
pywinauto is a set of python modules
to automate the Microsoft Windows GUI. At it’s simplest it allows you
to send mouse and keyboard actions to windows dialogs and controls.