'How to trigger an action after a certain number of mouse clicks in Python?

I need an action to be triggered after the user left-clicks anywhere on screen three times.

So it should look like this:

After three clicks with the mouse, a given action is triggered.

Many thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source