on a click write the current x,y as motion has updated it to writableX and writabley, then call repaint(), and then in your paint method use DrawString to write the cordinates of that click out somewhere in window.
if your drawing on a panel, make your panel class implement both listners. use the add method to add both listeners, and then you just need to copy in the methods of each listener ( with no code in at first). then add the code as i outlined, writing the x,y in motion and writing the writable x,y in click and repaint. You will get error methods if you use the implement and add but fail to copy in all methods. there is maybe 4 or 5 for each.
You can actually just use a motion listener and on each call to change in motion, mouse dragged in think, assign x,y and repaint and use drawstring in paint to print where the mouse is hovering at the moment, at a given spot like 50,50 on screen.
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: