python自动关机

import time
#from os import system
import os
runing = True
while runing:
    inputs =input('关机(s),重启(r)')
    inputs = inputs.lower()
    if inputs == 's':
        print("关机ing")
        os.system("shutdown -s -t  60 ")
    elif inputs == 'r':
        print("重启ing")
#        system('reboot')
    else:
        print("程序错误重新输入")
print("程序结束~~~!")
posted @ 2020-08-31 20:15  kuanleung  阅读(15)  评论(0)    收藏  举报  来源