Python:实现电脑重启关机程序
这段代码可能需要管理员权限才能正常运行。
import os
def restart_computer():
if os.name == 'nt':
os.system('shutdown /r /t 0')
elif os.name == 'posix':
os.system
import os
def restart_computer():
if os.name == 'nt':
os.system('shutdown /r /t 0')
elif os.name == 'posix':
os.system