python写的 状态显示工具
本帖最后由 qwq 于 2023-10-25 20:53 编辑import tkinter as tk
import psutil
import asyncio
import time
print('cpu count: {}'.format(psutil.cpu_count()))
for x in range(1):
print('cpu percent: {}'.format(psutil.cpu_percent(interval=0.3)))
window = tk.Tk()
window.attributes('-alpha',0.8)
window.attributes("-topmost",True)
window.overrideredirect(1)
main_lable = tk.Label()
main_lable.pack()
window.geometry("+850+800")
def cchange():
usage = "CPU使用量" + str(psutil.cpu_percent(interval=0.3)) + "%" + "RAM使用量" + str(psutil.virtual_memory()) + "%"
main_lable.config(text = usage)
window.after(1000, cchange)
window.after(1000, cchange)
window.mainloop()
支付原创,可以玩一玩。 支付原创,我也试看看
页:
[1]