python版本的仿windows计划任务工具_python
这篇文章主要介绍了python版本的仿windows计划任务工具,计划任务工具根据自己设定的具体时间,频率,命令等属性来规定所要执行的计划,当然功能不是很全大家可以补充
计划任务工具-windows
计划任务工具根据自己设定的具体时间,频率,命令等属性来规定所要执行的计划。
效果图
立即学习“Python免费学习笔记(深入)”;
代码
# -*- coding: utf-8 -*-"""Module implementing App."""from PyQt4.QtGui import QMainWindowfrom PyQt4.QtCore import pyqtSignatureimport time,osimport QtUtilimport shutilimport timefrom v.Ui_App import Ui_MainWindowclass App(QMainWindow, Ui_MainWindow): """ Class documentation goes here. """ def __init__(self, parent = None): """ Constructor """ QMainWindow.__init__(self, parent) self.setupUi(self) # 创建'res/command'文件夹 if os.path.exists('res/command'): pass else: os.mkdir('res/command') # self.startDate.textFromDateTime() @pyqtSignature("") def on_run_btn_clicked(self): """ 创建任务. """ # 在查询栏显示的内容 cmd = self.taskRun.toPlainText() # 构建'res/command/01.txt'文件 if not os.path.exists('res/command/01.txt'): m = open('res/command/01.txt','w') m.close() p = str(self.modifier.text()) # 判断日期是否正确 if self.endDate.text() <p></p><p>“任务名称”填写任务的名字,计划类型选择时间,频率填写次数,在计划类型中除了monthly之外的其他类型都填写频率,monthly时日期填写日期号数,月份也只在选择monthly时候需要选择,其他时候不用选择,月份中*号问任意月,接着填写开始时间、开始日期、结束日期,结束日期要大于开始日期,最后填写所要执行的命令,则任务创建成功。,创建任务后随时可以查阅任务,点击查询任务即可,删除任务只要填上要删除的任务名称,点击删除任务即可,清空任务为删除所有任务。</p><p class="art_xg"><br></p><p class="clearfix"><span class="jbTestPos"></span></p>