一、
需求:
一遍干别的一遍录屏,需要屏幕时间到了会提醒自己(弹窗方式)
实现:
import time import tkinter.messagebox def countdown(m): try: m = int(m) except ValueError: print("Must be an integer!") else: while True: for minute in range(m, -1, -1): if minute == 0: break for second in range(59, -1, -1): time.sleep(1) print("{}:{}".format(minute-1, second)) tkinter.messagebox.showinfo("continue", "该切录屏啦!!!") break if __name__ == ‘__main__‘: countdown(2)
效果: