Re,

Voici un essai de barre de progression (je me répète, ... mais de nouveau merci à airod pour le coup de main dans un thread précédent) ... ça fonctionne bien, mais l'affichage est particulièrement lent à mon goût ! . N'y a-t-il pas une solution pour améliorer ça ?, en tous cas voici le bout de code (c'est juste un essai) :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /usr/bin/python
 
from Tkinter import *
root=Tk()
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]*1000
 
# CA MARCHE MAIS L'AFFICHAGE EST BEAUCOUP TROP LENT !!!
for toto in range(len(listeESSAI)) :
	calcPourcentage=((toto+1)*100)/len(listeESSAI)
	c.update()
	n1=0
	while n1<=calcPourcentage*4 :
		c.create_rectangle((n1, 1, 4+n1, 20), outline="white", fill="red", width=1)
		n1=n1+4
 
root.mainloop()
Merci d'avance .

a+