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

原文地址:https://www.cnblogs.com/czb529514/p/7676074.html