May-20-2022, 05:37 PM
Hi,
I am trying to rotate images on canvas using Tkinter after() method.
My images dont appear in the window and they dont seem to rotate. I get an error message:
Thank you
I am trying to rotate images on canvas using Tkinter after() method.
My images dont appear in the window and they dont seem to rotate. I get an error message:
Error:invalid command name "3064880984move"
while executing
"3064880984move"
("after" script)Here's the code:from tkinter import *
from PIL import Image, ImageTk
ws = Tk()
ws.title('PythonGuides')
#ws.geometry("800x1000")
l = Label(ws, font = "bold")
l.pack()
x = 1
def move():
global x
if x == 3:
x = 1
if x == 1:
img = PhotoImage(file='/home/pi/Desktop/sasuke.png')
Label(ws, image=img).pack()
elif x ==2:
img2 = PhotoImage(file='/home/pi/Desktop/3.png')
Label(ws, image=img2).pack()
elif x ==3:
img3 = PhotoImage(file='/home/pi/Desktop/Master-Warning-Light.png')
Label(ws, image=img3).pack()
x+=1
ws.after(2000,move)
move()
ws.mainloop()Anyone familiar with that type of error?Thank you
