Here we are providing basic tutorial in Tkinter
to intrduce mouse click events in your program.
Consider this code
from tkinter import *
root = Tk()
frame=Frame(root, width=300, height=250)
In above code, two events are created, one for leftClick
function and one for rightClick
function. Then both are binded with their respective events.
Rest code is self-explanatory.
On clicking the left mouse button, output will appear on command window like this -
On clicking the right mouse button, output will appear on command window like this -