pynput

Code(keylogger) converted into .exe with pyinstaller not working as it was

本秂侑毒 提交于 2021-02-11 14:45:22
问题 I was working with a keylogger code in python 3.5. It records keystrokes with pynput in a txt file and also sends the keystrokes recorded via email with smtplib. The code works correctly as it should when it is a .py file but doesn't record keystrokes in a file nor sends them through email when converted into a .exe file with pyinstaller. Please help me find out what's causing this problem and fix it. Thank you for looking into this matter. Have a good day! I used the command pyinstaller - w

Python pip install doesn't install pynput?

♀尐吖头ヾ 提交于 2021-02-11 14:18:36
问题 When I type pip install pynput in the command prompt it just says collecting pynput and doesn't install. I have already checked to make sure pip works. I am using Python 3.5.0. 回答1: Upgrade pip python -m pip install --upgrade pip Then Try: python -m pip install pynput 来源: https://stackoverflow.com/questions/61048438/python-pip-install-doesnt-install-pynput

type(list[0]) returns pynput.keyboard._win32.KeyCode

假装没事ソ 提交于 2021-02-05 11:57:17
问题 My problem is how pynput returns the data (I hope that's how you would say it?). So what I'm trying to do is have the listener record keyboard input, then use what letters are added to the list to make a string in word. Although, it seems like the letters aren't strings. Instead they return as pynput.keyboard._win32.KeyCode Is there a way to convert that to a python readable string or something? Like if: i typed f, t, w print(type(list[0]), word) return 'f', ftw what it comes out as so far is

OBS doesn't receive hotkey from python script

那年仲夏 提交于 2021-01-29 11:33:13
问题 I am trying to do automatic scene changer in OBS by having a python script search for a specific image on screen. When the image is detected, the python script will send the hotkey, which should be picked by OBS (Same hotkey added in program). However, I tried this in various applications like chrome/notepad/some games/etc and the hotkeys DO get "transmitted", but OBS doesn't pick them up. I don't know why, any help ? 回答1: From this thread: Key Presses in Python It seems like you need to

How to stop a program when a key is pressed in python?

北战南征 提交于 2021-01-21 05:49:48
问题 I have a program that is an endless loop that prints "program running" every 5 seconds and I want to stop it when I press the end key. So I created a key listener that returns false if the end key is pressed. That should work if I won't have the endless loop. And I want it to work even when I'm in the endless loop. Here's my code: from pynput import keyboard import time def on_press(key): print key if key == keyboard.Key.end: print 'end pressed' return False with keyboard.Listener(on_press=on

How to stop a program when a key is pressed in python?

最后都变了- 提交于 2021-01-21 05:49:45
问题 I have a program that is an endless loop that prints "program running" every 5 seconds and I want to stop it when I press the end key. So I created a key listener that returns false if the end key is pressed. That should work if I won't have the endless loop. And I want it to work even when I'm in the endless loop. Here's my code: from pynput import keyboard import time def on_press(key): print key if key == keyboard.Key.end: print 'end pressed' return False with keyboard.Listener(on_press=on

How can a Tkinter work with a Listener together?

给你一囗甜甜゛ 提交于 2021-01-06 18:22:43
问题 I have written a Tkinter and I hope to have a Listener to monitor the Keyboard Input by Users. But when I use mainloop() to start the Tkinter, the Listener cannot work together with it, and will start until I quit Tkinter. I have tried to add this Listener in Tkinter sub-unit, but it does not work as the same. def initialization(): print("Starting...") print("Start listener...") with mouse.Listener(on_click=onMouseClick) as listener: listener.join() if __name__ == "__main__" : root = tk.Tk()

Getting error when using pynput with pyinstaller

故事扮演 提交于 2020-12-30 03:00:52
问题 A friend of mine asked me to write him a program, and I used pynput to handle some of the inputs and other features. When I convert the program an executable with pyinstaller, launcing the executable gives me this error: File "site-packages\pynput\keyboard\__init__.py", line 31, in <module> File "site-packages\pynput\_util\__init__.py", line 82, in backend ImportError [11492] Failed to execute script friend_project I have tried using the pyinstaller command pyinstaller --onefile friend

Python pynput - program lags upon start

梦想与她 提交于 2020-12-12 09:59:26
问题 So I've been trying to make a simple program that, upon clicking the right mouse button, makes my mouse click the left button 3 times in 0.5 second intervals. However, when I start the program and do right click, the program does what it's told to do but also starts lagging horrendously for about 25 seconds. After it's done lagging and I try to close the program, it freezes, forcing me to close it via task manager. The code is as follows: import time from pynput.mouse import Button,

ImportError: No module named pynput.keyboard

こ雲淡風輕ζ 提交于 2020-11-30 00:10:05
问题 I have a problem and I can't find anything to help.The idea is that I can't import pynput. I did the pip install and this is what it shows: > Traceback (most recent call last): File "sb.py", line 1, in <module> from pynput.keyboard import Key, Controller ImportError: No module named pynput.keyboard I tried again pip install pynput and it shows Requirement already satisfied Here is the code, i don't know if it helps but there you go: from pynput.keyboard import Key, Controller def game():