Skip to content
Advertisement

Is there a way to iterate through certain types of objects on a canvas in python tkinter?

For example, I’ve got a bunch of text objects of varying font families on a canvas, can I make some kind of call to iterate through these text objects and alter them?

Advertisement

Answer

You can get a list of all items on a canvas with the find_all() method and then just list them:

JavaScript

Have a look at effbot: The Tkinter Canvas Widget for additional info on canvas.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement