Ошибка tkinter, при использовании gif анимации в python. ("after" script)
from tkinter import *
import time
import os
root = Tk()
frameCnt0 = 12
frames = [PhotoImage(file='C:\\Python\\1.gif',format = 'gif -index %i' %(i)) for i in range(frameCnt0)]
def update(ind):
frame = frames[ind]
ind += 1
if ind == frameCnt0:
ind = 0
label.configure(image=frame)
root.after(100, update, ind)
label = Label(root)
label.pack()
root.after(0, update, 0)
root.mainloop()
root1 = Tk()
frameCnt1 = 12
frames = [PhotoImage(file='C:\\Python\\2.gif',format = 'gif -index %i' %(i)) for i in range(frameCnt1)]
def update(ind):
frame = frames[ind]
ind += 1
if ind == frameCnt1:
ind = 0
label.configure(image=frame)
root1.after(100, update, ind)
label = Label(root1)
label.pack()
root1.after(0, update, 0)
root1.mainloop()
root2 = Tk()
frameCnt2 = 12
frames = [PhotoImage(file='C:\\Python\\3.gif',format = 'gif -index %i' %(i)) for i in range(frameCnt2)]
def update(ind):
frame = frames[ind]
ind += 1
if ind == frameCnt2:
ind = 0
label.configure(image=frame)
root2.after(100, update, ind)
label = Label(root2)
label.pack()
root2.after(0, update, 0)
root2.mainloop()
выводит в консоль
invalid command name "17167785update
While executing
("after script")
# invalid command name "26373832update
While executing
26373832update
("after script")