Python 学习:今天写了一个简单的定时任务

今天有一个很简单的需求,要求定时执行一个 .bat 批处理文件。于是查看了一下 Python 文档,写出如下脚本:

from win32api import *
from time import *

= 1
while 1:
    ShellExecute(0, None, 
"c:\\test.bat", None, "c:\\", True)    
    
print "The job has been executed", i, "times till now."
    i 
+= 1
    sleep(
10 * 60)

posted on 2006-02-28 23:45  NeilChen  阅读(3222)  评论(4编辑  收藏  举报

导航