From e28ff5bdbf49a8d21675e29aea92a633d61174d1 Mon Sep 17 00:00:00 2001 From: didier Date: Fri, 12 Mar 2021 21:12:11 +0000 Subject: [PATCH] Prediction prints to have flag to use or not use color --- gamestonk_terminal/helper_funcs.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gamestonk_terminal/helper_funcs.py b/gamestonk_terminal/helper_funcs.py index 137c419f793..4dfae92c5a6 100644 --- a/gamestonk_terminal/helper_funcs.py +++ b/gamestonk_terminal/helper_funcs.py @@ -300,10 +300,14 @@ def price_prediction_color(val: int, last_val: int) -> str: def print_pretty_prediction(df_pred: pd.DataFrame, last_price: float): - print(f"Actual price: {Fore.YELLOW}{last_price:.2f} ${Style.RESET_ALL}\n") - - print("Prediction:") - print(df_pred.apply(price_prediction_color, last_val=last_price).to_string()) + if gtff.USE_COLOR: + print(f"Actual price: {Fore.YELLOW}{last_price:.2f} ${Style.RESET_ALL}\n") + print("Prediction:") + print(df_pred.apply(price_prediction_color, last_val=last_price).to_string()) + else: + print(f"Actual price: {last_price:.2f} $\n") + print("Prediction:") + print(df_pred.to_string()) def check_ohlc(type_ohlc: str) -> str: