我搞砸了吗? Python,shutdown命令 [英] Did I mess up ? Python, shutdown command

查看:359
本文介绍了我搞砸了吗? Python,shutdown命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sup,



我尝试在30分钟前创建一个小程序来测试关机命令。



程序代码:



导入os

os.system('shutdown-s')



现在没有关闭,windwos开始准备(30分钟前)



任何想法可能出错?或者我现在应该做什么?



我尝试过:



我只是试着等待并将它连接到电源,但它似乎什么也没做。我想知道它是否随机决定更新。



这是一台笔记本电脑。

Sup,

I tried creating a small programm to test the shutdown command 30 mins ago.

program code:

import os
os.system(´shutdown-s´)

Now instead of shutting down, windwos started preparing(30 mins ago)

Any ideas what could have gone wrong? Or what i should do now?

What I have tried:

I only tried waiting and conecting it to a power source, but it doesn´t seem to do anything. Im wondering if it randomly decided to update.

It is a laptop btw.

推荐答案

猜Windows正准备安装一个重大更新。在应用程序中调用关闭表单绝不是一个好主意。
At a guess Windows is preparing to install a major update. Calling shutdown form inside an application is never a good idea.


Windows关闭的正确语法是' shutdown / s '。在任何情况下,必须以管理员权限执行脚本才能实际关闭系统。
The correct syntax for Windows shutdown is 'shutdown /s'. In any case the script must be executed with administrator rights in order to actually shutdown the system.


这篇关于我搞砸了吗? Python,shutdown命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆