两小时后执行打开浏览器的操作

"""
Use python open browser after two hours
"""
#-*- coding:utf8 -*-
import time
import webbrowser

total_break = 3
break_count = 0
print("This Program started on " + time.ctime()) #time.ctime get the current time
while break_count <total_break:
time.sleep(2*60*60) #execute the action after Two hours
webbrowser.open("http://www.sina.com.cn")
break_count += 1
posted @ 2017-03-22 15:07  村西崔二  阅读(137)  评论(0编辑  收藏  举报