Python Keylogger (Educational Project)
This is a simple keylogger written in Python using the pynput library. It logs keystrokes typed by the user and stores them in a text file (key_log.txt) automatically created inside a logs folder.
This project is for educational and ethical use only.
Do not use this script to record input without clear consent from the user.
Unauthorized use may violate privacy laws and is illegal.
- Logs all keyboard inputs (letters, numbers, special keys)
- Auto-creates
logs/key_log.txtif it doesn’t exist - Stops logging when
Enterkey is pressed - Uses the
pynputlibrary (cross-platform)
- Python 3.6+
pynputmodule
Install the required module:
pip install pynput