From 67724b6742786baaca99c81b95e2533393479b57 Mon Sep 17 00:00:00 2001 From: Anthex Date: Mon, 22 Apr 2019 16:53:10 +0200 Subject: [PATCH] add color output format for easier reading --- main.py | 5 ++--- structure.py | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index ae4052f..3069705 100644 --- a/main.py +++ b/main.py @@ -3,8 +3,7 @@ import sys Tf = [] #cells table -testSamples = [RSSVector(-26, -42, -13, -46), RSSVector(-26, -42, -13, -46), RSSVector(-26, -42, -13, -46)] -testSample = testSamples[0] +testSample = RSSVector(-26, -42, -13, -46) #cells Table initialization for i in range (0, 3): @@ -39,7 +38,7 @@ def main(args): #### Markov #### MM = MarkovModel(Tf) - MM.path([8,7,8,7,8,7,8,5,8,2,9,8,1,9,8,9,5,4,3,2,3,2,4,5,4,5,6,6,7,6,9,5,9,3]) + MM.path([8,7,8,7,8,7,8,5,8,2,9,8,1,9,8,9,5,4,3,2,3,2,4,5,4,5,6,6,7,6,9,5,9,3,2,4,3,5,3,4,3,3,5,6,7,6,7,6,5,4,3,4,3,4]) MM.printValues() print("\r\nPERCENTAGES : \r\n") diff --git a/structure.py b/structure.py index 6bc0528..6789b40 100644 --- a/structure.py +++ b/structure.py @@ -120,7 +120,12 @@ class MarkovModel(): print(i, end='\t') for k in range (0,10): - print(str(floor(self.MarkovValues[i][k].percentage * 100)), end='\t') + if not self.MarkovValues[i][k].percentage: + print("\033[0;31;40m", end='') + else: + print("\033[1;36;40m", end='') + print(str(floor(self.MarkovValues[i][k].percentage * 100)), end='%\t') + print("\033[1;37;40m", end='') print("") def getMostLikely(self): -- libgit2 0.21.4