from psutil import boot_time from time import time def main(): bootTime = (time()-boot_time())/3600 print("开机时间:{}h".format(round(bootTime,1))) if __name__=="__main__": main()
from psutil import boot_time from time import time def main(): bootTime = (time()-boot_time())/3600 print("开机时间:{}h".format(round(bootTime,1))) if __name__=="__main__": main()