资源简介
代码片段和文件信息
import os
import time
from datetime import datetime
def close_job1(times):
print(
‘现在是‘
time.strftime(
‘%Y-%m-%d %H:%M:%S‘
time.localtime(
time.time())))
now = str(datetime.now()).rpartition(“:“)[0].split(“ “)[1]
now_tosec = (int(now.split(“:“)[0]) * 60 + int(now.split(“:“)[1])) * 60
t_tosec = (int(times.split(“:“)[0]) * 60 + int(times.split(“:“)[1])) * 60
diff = int((t_tosec - now_tosec) / 60)
print(“定时任务启动,系统将在 {},即{}分钟后 自动关闭“ .format(times diff))
command = “shutdown -s -t {}“.format(diff * 60)
os.system(command)
def close_job2(times):
print(
‘现在是‘
time.strftime(
‘%Y-%m-%d %H:%M:%S‘
time.localtime(
time.tim
相关资源
- python 入门级windows(桌面应用程序)
- python编写windows桌面程序
- tensorflow版本的YOLO v3,在Windows系统下
- Python 3.71 rc1 windows install
- wxPython for py27 windows
- crontab调用pythonpython中封装kettle的定时
- Caffe windows python快速配置
- python 3.5 下的pygraphviz安装whl for 64位
- python 3.7 下的pygraphviz安装whl for 64位
- Windows安装dlib的轮子dlib-18.17.100-cp27-
- 京东定时自动秒杀工具
- mod_wsgi-3.5-for-windows32/64-apache2.2/2.4-py
- zbar windows64位 python2.7安装包
- Python下的Twisted模块(Windows平台)
- MySQLdb模块1.2.2(py2.5 win32)
- ActivePython 2.5.5.7 windows版
- Python 3.1.1 Windows X86-64 MSI Installer
- Python 2.6.4 Windows X86-64 installer
- Python 3.1.1 Windows x86 MSI Installer
评论
共有 条评论