Pause Program When Mouse is Handled by pynput

175
July 24, 2018, at 04:00 AM

When I am using pynput library to control my mouse for some boring job, I cannot pause the program since the mouse is in use. Are there any good ways to solve this problem? Can I pause in the for loop when ever I want? Maybe setup a keyboard listener for a shortcut key press?

from pynput.mouse import Button
from pynput.mouse import Controller as mc
import time
mouse = mc()
for i in range(100):
    mouse.position = (73, 551)
    mouse.click(Button.left, 1)
    time.sleep(0.1)
    mouse.position = (248, 628)
    mouse.click(Button.left, 1)
    time.sleep(0.1)

Thanks in advance.

Rent Charter Buses Company
READ ALSO
calculate the mad() of every two values of a dataframe

calculate the mad() of every two values of a dataframe

I have a dataframe that looks like:

157
Strange python's hashlib.md5 behavior, different hash each time

Strange python's hashlib.md5 behavior, different hash each time

I've faced some really strange behavior trying to calculate md5 hash of stringReturned hash is always wrong (and different) if I pass string that was result of concatenation

148
I want to capture frame(video) using HTC VIVE front facing Camera + OpenCV in python

I want to capture frame(video) using HTC VIVE front facing Camera + OpenCV in python

I want to capture frame(video) using HTC VIVE front facing Camera + OpenCV in python

175