藝賽旗 RPA9.0全新首發免費下載下傳 點選下載下傳
http://www.i-search.com.cn/index.html?from=line1
往往我們流程設計的時候沒有用到管理平台,我們就簡單的使用 time 子產品,終究覺得不是很好。
今天看到一個比較人性化的定時子產品 schedule,目前 star 數為 6432,還是非常的受歡迎,這個子產品也是秉承這 For Humans 的原則,這裡推薦給大家。位址 https://github.com/dbader/schedule
-
通過 pip 即可安裝。
pip install schedule
-
使用案例
import schedule
import time
def job():
print(“I’m working…”)
schedule.every(10).minutes.do(job)
schedule.every().hour.do(job)
schedule.every().day.at(“10:30”).do(job)
schedule.every().monday.do(job)
schedule.every().wednesday.at(“13:15”).do(job)
schedule.every().minute.at(":17").do(job)
while True:
schedule.run_pending()
time.sleep(1)
從單詞的字面意思,你就知道這是做什麼的。
舉個例子:
schedule.every().monday.do(job)
這句代碼作用就是就是單詞意思,定時器會每個周一運作函數 job,怎麼樣是不是很簡單。