how to create a keylogger using a python????

Recommended Answers

All 3 Replies

This will do it ...

# tk_KeyLogger.py
# show a character key when pressed

try:
    # Python2
    import Tkinter as tk
except ImportError:
    # Python3
    import tkinter as tk

def key(event):
    """show just the character key"""
    if event.keysym == 'Escape':
        root.destroy()
    print(event.char)

root = tk.Tk()
print("Press a key (Escape key to exit): ")
root.bind_all('<Key>', key)
# don't show the tk window
root.withdraw()
root.mainloop()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.