From a3c3290a263174473058019572e9e5174dacb105 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Fri, 28 Aug 2015 14:41:10 +0200 Subject: [PATCH] Ajout d'un total sur stats_cableur --- utils/stats_cableurs2.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/stats_cableurs2.py b/utils/stats_cableurs2.py index 0b797141..84ab0050 100755 --- a/utils/stats_cableurs2.py +++ b/utils/stats_cableurs2.py @@ -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__":