psutil
import psutil,datetime#cpuprint("cpu_times:\t",psutil.cpu_percent(),"\n")#内存mem = psutil.virtual_memory()print("mem_total:\t",int(mem.total/1024/1024),"MB")print("mem_free:\t",int(mem.free/1024/1024),"MB")#磁盘partitions = psutil.disk_partitions()print("the partitions:\t",partitions,"\n")usage_c = psutil.disk_usage('C:\\').percentprint("disk c\ usage:\t",usage_c,"%\n")disk_io = psutil.disk_io_counters(perdisk=True)print("disk_io:\t",disk_io,"\n")#网络net_io = psutil.net_io_counters()print("net_io:\t",net_io,"\n")#登录用户login_users = psutil.users()[0][0]print("login_user:\t",login_users,"\n")#开机时间boot_time = datetime.datetime.fromtimestamp(psutil.boot_time())print("boot_time:\t",boot_time,"\n")#进程ps = psutil.pids()print("ps:\t",ps,"\n")#IP#下次再说