#!/usr/bin/python # -*- coding: utf-8 -*- from tkinter import * import time window = Tk() sizex = 400 sizey = 200 canvas = Canvas(window, width = sizex, height = sizey) canvas.pack() x = 100 # initial left-most edge of first ball y = 30 # initial top-most edge of first ball r = 20 # ball diameter depx = 2 # displacement at each move in x direction depy = 1 # displacement at each move in y direction ball=canvas.create_oval(x,y,x+r,y+r,fill="blue") #moves no_moves = 140 for j in range(no_moves): canvas.move(ball, depx, depy) canvas.after(20) # time delay in milliseconds canvas.update() time.sleep(5) # on attend quelques secondes window.destroy()