An60s
这是一个非常轻量的由Python开发的快捷小软件,打开它即可自动获得一张 60s读懂世界 的早报图片
使用技巧
当然是把他设置为开机启动,每天打开电脑就会自动打开早报图片啦!
早报实例图片
开源代码
import requests
import json
import os
from PIL import Image
import ctypes
ctypes.windll.kernel32.SetConsoleTitleW("每天60s读懂世界 --by 小安")
url = "https://api.2xb.cn/zaob"
if not os.path.exists("logs"):
os.mkdir("logs")
resp = requests.get(url)
sec = json.loads(resp.text)
ImageUrl = sec["imageUrl"]
FileName = sec["datatime"]+".png"
rec = os.getcwd() + f"\\logs\\{FileName}"
with open(f"logs/{FileName}", mode="wb") as f:
f.write(requests.get(ImageUrl).content)
image = Image.open(rec)
image.show()
f.close()
image.close()
resp.close()
下载地址
温馨提示:此处内容已隐藏,回复后刷新页面即可查看!
文章评论
能问问你的博客是用的什么平台么?
@eurus WordPress 哈哈