The Python Oracle

How to increase number of clicks per second with pyautogui?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Track title: CC O Beethoven - Piano Sonata No 3 in C

--

Chapters
00:00 Question
00:49 Accepted answer (Score 18)
01:33 Thank you

--

Full question
https://stackoverflow.com/questions/3580...

Accepted answer links:
[doc]: https://pyautogui.readthedocs.org/en/lat...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #python3x #pyautogui

#avk47



ACCEPTED ANSWER

Score 21


You can set pyautogui.PAUSE to control the duration of the delay between actions. By default, it is set to 0.1 sec, that is why you are getting at most 10 clicks per second.

pyautogui.PAUSE = 0.01

for example will reduce the delay to allow 100 clicks per second if your hardware supports it. From the doc, you can read the following:

You can add delays after all of PyAutoGUI’s functions by setting the pyautogui.PAUSE variable to a float or integer value of the number of seconds to pause. By default, the pause is set to 0.1 seconds.