2018-05-16 2 个评论 编程 469 字数
# -*- 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(终于入门了 能写一个功能了)
最后修改时于2018 年 05 月 16 日 05 时 21 分 PM
测试评论
测试评一下。