Jul-14-2017, 05:00 PM
I am trying to get the keystrokes values and put inside the file but nothing is written there and no errors.
filePath='D:\\test2.txt' def OnKeyboardEvent(e): global keylog keylog= chr(e.Ascii) with open(filePath,'a') as f: f.write(keylog) f.close() return True h_m=pyHook.HookManager() h_m.KeyDown = OnKeyboardEvent h_m.HookKeyboard() pythoncom.PumpMessages()Thanks