python 定时任务的执行

#coding=utf-8
import os,time
k=1
while k <2:
  now_time=time.strftime('%H_%M')
  if now_time == '21_00':
    print u"开始运行脚本:"
    os.chdir("E:\\test_object")
    os.system('Python all_test.py') #执行脚本
    print u"运行完成退出"
    break
  else:
    time.sleep(10)
    print now_time

posted @ 2017-10-16 11:11  琦琦爸爸  阅读(458)  评论(0编辑  收藏  举报