本文介绍了如何使用Python关闭计算机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我编写了一个Python脚本,该脚本最终应关闭计算机。
I've written a Python script which should eventually shutdown the computer.
此行是其中的一部分:
os.system("shutdown /p")它会进行某种形式的关闭,但仍处于打开状态Windows控制面板(用户可以在其中切换计算机用户)。
It makes some sort of a shutdown but remains on the turn-on Windows control pannel (where the user can switch the computer users).
有没有办法完全关闭计算机?
Is there a way to fully shutdown the computer?
我尝试了其他 os.system( shutdown ___)方法都没有成功。
I've tried other os.system("shutdown ___") methods with no success.
还有另一种方法可能会帮助吗?
Is there another method which might help?
推荐答案import os os.system('shutdown -s')
此会为您工作。
更多推荐
如何使用Python关闭计算机
发布评论