0

I'm using colorama to color my terminal. I have a auto updater and I colored it up. The output I get if I compile it into a exe is:

←[36mYour ←[34mVersion ←[36mis Old!
press enter to Update the Application to v0.0.2.2...

No color at all. I think it's a bug because if I don't compile it to a exe it works.

This is my code:

print(f"{Fore.CYAN}Your {Fore.BLUE}Version {Fore.CYAN}is Old!\n"
      f"press enter to Update the Application to {updatecheck}...")
martineau
  • 99,260
  • 22
  • 139
  • 249
LeQuit
  • 27
  • 6
  • 2
    Those "random things" are ANSI colour codes: https://en.wikipedia.org/wiki/ANSI_escape_code – jonrsharpe Nov 06 '20 at 15:04
  • It supports them because i already got it on my main screen it just dont works there – LeQuit Nov 06 '20 at 15:07
  • And if i run it in a Py file it works only not in exe file – LeQuit Nov 06 '20 at 15:09
  • It sounds like the `colorama` module isn't being included by whatever you're using to "compile" the script into an `.exe` — so make sure you've done what is necessary to make that happen. – martineau Nov 06 '20 at 15:50

1 Answers1

0

first, I made a list of all the colors, To randomly select color

(color_random) in code for : Choose colors randomly

and you should read the examples of colorama

import random
from colorama import init, Fore, Style
init()

color_list = [Fore.RED, Fore.GREEN, Fore.YELLOW, Fore.BLUE, Fore.MAGENTA, Fore.CYAN, Fore.CYAN, Fore.WHITE]
color_random = random.choice(color_list)

updatecheck = "v0.0.2.2..."

print(Fore.CYAN+"  your", Fore.BLUE+"Version", Fore.CYAN+"is Old!\n",
    Style.RESET_ALL, "press enter to Update the Application to", color_random+updatecheck, Style.RESET_ALL)
  • Please don't post only code as an answer, but also provide an explanation of what your code does and how it solves the problem of the question. Answers with an explanation are usually more helpful and of better quality, and are more likely to attract upvotes – Ran Marciano Mar 03 '21 at 08:06
  • @RanMarciano Thanks for the explanation. I'm setting it up now – Novin.Nouri Mar 03 '21 at 14:39