-
-
Save franciscogomes2020/99332866903d9b023eda0dee5e00d57d to your computer and use it in GitHub Desktop.
Despertador em Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Despertador em Python programado para enviar uma Mensagem Box de 15 em 15 minutos | |
from datetime import datetime | |
from time import sleep | |
import ctypes | |
segundosParaDormir = 60 | |
while True: | |
a = datetime.now() | |
if a.minute == 15 or a.minute == 30 or a.minute == 45 or a.minute == 00: | |
print(f'despertou em {a}' ) | |
retorno = ctypes.windll.user32.MessageBoxW( | |
0, | |
f'{a}\n\nOK continuar despertando\n\nCANCELAR fecha o programa', | |
'despertador 15 em 15 minutos', | |
1) | |
if retorno == 2: | |
break | |
sleep(segundosParaDormir) | |
# Messagem Box usada | |
# https://docs.microsoft.com/pt-br/windows/win32/api/winuser/nf-winuser-messageboxw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment