'How to get image X Y coordinates and a pixel value at the indicated point by cursor with Python?

I have a gray scale image which size is (5472, 3648). How does python return the pixel value and x y cordinates of an point in the image? I want to get the values when I set the cursor and click the point in the image?



Sources

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

Source: Stack Overflow

Solution Source