Ajout d'un total sur stats_cableur

This commit is contained in:
Gabriel Detraz 2015-08-28 14:41:10 +02:00
parent 241b760921
commit a3c3290a26

View file

@ -130,7 +130,14 @@ def show_all(limit, swap):
largeur = [25, 8, 16, 16]
alignement = ["c", "c", "c", "c"]
data = [[elem for elem in SCORES[index]] for index in xrange(limit)]
total = ['Total',0,0,0]
for elem in SCORES:
total[1]+=elem[1]
total[2]+=elem[2]
total[3]+=elem[3]
total = [total]
print affichage.tableau(data, titre=titre, largeur=largeur, alignement=alignement, swap=swap).encode(ENCODING)
print affichage.tableau(total, titre=titre, largeur=largeur, alignement=alignement, swap=swap).encode(ENCODING)
#### On définit le Parser
if __name__ == "__main__":