health

import tkinter
import time


class Reminder:
    def __init__(self, text):
        self.root = tkinter.Tk()
        self.root.overrideredirect(True)
        self.root.geometry('{0}x{1}+0+0'.format(
            self.root.winfo_screenwidth(),
            self.root.winfo_screenheight()
        ))

        self.root.config(bg="lightgreen")
        tkinter.Label(self.root, text=text,
                      fg='white', bg='lightgreen',
                      font=('Consolas', 230)).place(
            relx=0.5,
            rely=0.5,
            anchor='center'
        )

        self.root.after_idle(self.show)

    def hide(self):
        self.root.withdraw()
        self.root.quit()

    def show(self):
        self.root.deiconify()
        self.root.after(1000 * 5, self.hide)

    def start(self):
        self.root.mainloop()


while True:
    main = Reminder("Stand up!")
    main.start()
    time.sleep(1800)

posted @ 2018-08-20 11:07  idlewith  阅读(151)  评论(0编辑  收藏  举报