In the last tutorial we looked at the Canvas widget from Tkinter and we also had a look at the concept of cartesian coordinate systems. In our example we could identify specific pixels by counting across and down from the top left of the canvas (ordinarily cartesian systems count left and up). We also bound the motion event to the canvas and used it to display the current coordinates of the mouse in the canvas. The reason we did this is because to draw anything on the canvas you need to know the coordinates of where it is to be drawn. In this tutorial we draw a line on the canvas (!!) and animate it so that it follows the mouse.
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.