Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the simply-static domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wp-includes/functions.php on line 6121
树莓派状态看板

树莓派状态看板

import streamlit as st
import psutil
import time

def main():
    st.title("树莓派状态看板")
    container = st.empty()
    while True:
        cpu_percent = psutil.cpu_percent()
        mem = psutil.virtual_memory()
        disk = psutil.disk_usage('/')
        container.write(f"CPU使用率: {cpu_percent}%")
        container.write(f"内存使用情况: {mem.percent}%")
        container.write(f"磁盘使用情况: {disk.percent}%")
        time.sleep(5)

if __name__ == '__main__':
    main()