我用 canvas 做的 不是label
from tkinter import *
from PIL import ImageTk, Image
from time import *
class Arrow():
def __init__(self):
self.root = Tk()
self.canvas = Canvas(self.root, width=400, height=375)
self.canvas.pack()
self.img = ImageTk.PhotoImage(Image.open("arrow.png"))
self.root.after(0, self.animation)
self.root.mainloop()
def animation(self):
while True:
for y in range(60, 525, 125):
sleep(1)
self.canvas.delete('all')
self.canvas.create_image(200, 375-y, image=self.img)
self.canvas.update()
Arrow()
preview: