I made a list in python named "worldPos" and it constantly adds the position of the mouse cursor to the list as x and y coordinates. How can I get the most recent x and y coordinates added to the list?
from Tkinter import *
root = Tk()
root.geometry('800x800')
cnv = Canvas(root, width = 800, height = 800)
cnv.pack()
worldPos = []
def motion(event):
x, y = event.x, event.y
worldPos.append((x,y))
root.bind('<Motion>', motion)
mainloop()