pythonで簡単な休憩の注意をします

1269 ワード

出典:Udacity『プログラミング基礎:Python』コース2
機能:30分おきに特定のページを開いて休憩を促す
#coding:utf-8
import webbrowser 
import time

total_breaks = 3
break_count = 0

print "
This program started on: "
+ time.ctime() # time.ctime():current time(sec) while break_count <= total_breaks: time.sleep(30 * 60# time.sleep():sleep time(sec) ,30 min print "
Break Time!\t"
+ time.ctime() webbrowser.open("https://cn.udacity.com/course/programming-foundations-with-python--ud036") # break_count = break_count + 1