Python 定时关机、重启命令

简介: os 中 system 函数可通过设定一些参数,实现开关机包含定时命令;另外声明一下,此代码块仅供科普,如果正在用电脑的话请勿尝试,

os 中 system 函数可通过设定一些参数,实现开关机包含定时命令;另外声明一下,此代码块仅供科普,如果正在用电脑的话请勿尝试,

import os
from os import system
# 关机
# os.system("shutdown -s -t  60 ")
# 重启
system("shutdown -r -t 100")
相关文章
|
7天前
|
关系型数据库 MySQL 数据库
Python tk dos命令备份mysql数据库
Python tk dos命令备份mysql数据库
30 0
|
7天前
|
Python
python封装执行cmd命令的方法
python封装执行cmd命令的方法
43 0
|
7天前
|
人工智能 JSON 测试技术
软件测试/人工智能|Python Pip 常用命令大全
软件测试/人工智能|Python Pip 常用命令大全
39 0
|
7天前
|
人工智能 Shell 程序员
[oeasy]python005_退出游乐场_重启游乐场_系统态shell_应用态_quit
[oeasy]python005_退出游乐场_重启游乐场_系统态shell_应用态_quit
19 0
|
7天前
|
Shell Python
[oeasy]python0003_ 终端大冒险_终端命令_whoami_pwd_ls
[oeasy]python0003_ 终端大冒险_终端命令_whoami_pwd_ls
39 5
|
6天前
|
Linux Shell Python
python实现Tree命令输出
python实现Tree命令输出
7 0
|
7天前
|
Python
【Python进阶(四)】——魔术命令
【Python进阶(四)】——魔术命令
|
7天前
|
Linux 数据安全/隐私保护 iOS开发
如何将python命令链接到Python3
如何将python命令链接到Python3
14 0
|
7天前
|
Shell 测试技术 Python
在Mac上用Python调用终端执行命令
在Mac上用Python调用终端执行命令
17 1
|
7天前
|
弹性计算 运维 Shell
设置Python 支持自动命令补齐功能
【4月更文挑战第29天】
10 0