我正在努力使用線程的Timer函數。 基本上,當我的程序啓動時,我想記錄每x秒的統計數據。 所以我認爲我可以用Timer函數(啓動函數每5秒)來完成。 現在,我所做的: from threading import Timer
def startLogger():
while True:
t = Timer(5, function)
t.start()
de
我正在閱讀數百條推文,並檢查這些推文中縮短的網址。 只是一個簡單的代碼流: 線程(S): def worker(tweets):
for tweet in tweets:
find shortened urls in tweet
result= process these urls (read the response body)
主要過程: Block ti