微信實時提醒python程式狀態

2021-08-15 12:22:20 字數 1006 閱讀 9042

1. 在用python做特徵提取或者構建模型時資料量大的話會消耗很多時間,每次都要過一會兒去看一下**是否跑完,很不方便。
1. 在python程式裡匯入itchat庫

3. 執行**,在需要接收提醒的地方用itchat給自己的大號傳送訊息

import itchat

itchat.auto_login(enablecmdqr=-1)#enablecmdqr在終端或命令列中為true,在notebook中為-1

defsendmessagetowechat

(markname=u'張三',message=u'已經處理完畢'):

''' message: 要傳送的內容

eg: sendmessagetowechat(markname=u'鵬舉',message=u'已經處理完畢')

'''#想給誰發資訊,先查找到這個朋友

users = itchat.search_friends(name=markname)

if users:

#找到username

username = users[0]['username']

itchat.send(message,tousername = username)

else:

print('通訊錄中無此人')

測試:from time import sleep

deffunc1

():

sleep(20)

deffunc2

(): sleep(40)

func1()

sendmessagetowechat(markname=u'張三',message=u'func1已經處理完畢')

func2()

sendmessagetowechat(markname=u'張三',message=u'func2已經處理完畢')

php呼叫百度天氣介面,微信實時檢視天氣

header content type text charset utf8 define token weixin wechatobj new wechatcallbackapitest if isset get echostr else class wechatcallbackapitest pr...

用Python寫課程提醒程式(一)

課程資訊儲存 時間 周,天 引入 程式遍歷每門課程的時間屬性 主程式獲取對應的時間屬性與引入時間屬性相符的課程屬性 主程式將獲取到的所有課程打包成陣列 呼叫郵件程式傳送課程到手機郵箱 一.資料產生 1 課程資訊儲存 考慮到可以推廣的話,可以寫乙個資料儲存介面,類似於課程格仔那樣子的,然後通過使用者互...

用python寫乙個定時提醒程式

較基礎,適合python新手及對python感興趣的同學閱讀。1。等待 3。重複 1,2兩步。因為我們要在一天內休息多次,迴圈3次好了。開啟python idle 讓我們開始吧!total breaks 3 重複3次 break count 0 while break count total bre...