# -*- coding: utf-8 -*-  

import requests
import time

file = open("/sys/class/thermal/thermal_zone0/temp")   
temp = float(file.read()) / 1000  
file.close()   
url = '这里改成你自己server酱的POST地址'
d = {'text': '温度播报' , 'desp':time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + "\n\n当前温度:%.1f" %temp}
r = requests.post(url,data=d)
print(r.text)


先上代码再BB

嗯最近是什么都要撸,撸完易语言撸py(终于入门了 能写一个功能了)


Last modification:May 16th, 2018 at 05:21 pm
如果觉得我的文章对你有用,请随意赞赏