from tkinter import *
tk = Tk()
canvas = Canvas (tk, width=500, height=500)
canvas.pack()
fish_obj Photo Image (file="fish.png")
id_img = canvas.create_image (50, 50, anchor-NW, image-fish_obj)
print (id_img)
import time
for i in range (1,100):
canvas.move(id_img,2,0)
tk.update()
time.sleep (0.02)
Объяснение:
from tkinter import *
tk = Tk()
canvas = Canvas (tk, width=500, height=500)
canvas.pack()
fish_obj Photo Image (file="fish.png")
id_img = canvas.create_image (50, 50, anchor-NW, image-fish_obj)
print (id_img)
import time
for i in range (1,100):
canvas.move(id_img,2,0)
tk.update()
time.sleep (0.02)
Объяснение: