1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| #! /usr/bin/python
from Tkinter import *
root=Toplevel()
root.geometry("510x100+0+0")
f=Frame(root, height=28, width=412, bd=2, relief=GROOVE)
f.place(x=46, y=60)
c=Canvas(f, height=20, width=404, bg="white")
c.place(x=1, y=1)
listeESSAI=[0]*10000000 ## NOTE LE CHANGEMENT DE VALEUR, sinon trop rapide
n1=0
for toto in range(len(listeESSAI)) :
calcPourcentage=((toto+1)*100.0)/len(listeESSAI)
c.update()
n1=n1
while n1<=calcPourcentage*4 :
c.create_rectangle((n1, 1, 4+n1, 20), outline="white",
fill="red", width=1)
n1=n1+4
print n1,
root.mainloop() |
Partager