Is there any way to print in the console with colored text?
>>> from colorama import Fore
>>> print(Fore.BLUE + "Hello World")
But in the console I got this:
>>> [34mHello World
I also tried other methods, but none of them help.
You could use the Python termcolor module:
from termcolor import colored
print colored('RED TEXT', 'red'), colored('GREEN TEXT', 'green')
You can also look into sty which is fairly similar to colorama. Here is an example from their GitHub page:
foo = fg.red + 'This is red text!' + fg.rs
bar = bg.blue + 'This has a blue background!' + bg.rs
baz = ef.italic + 'This is italic text' + rs.italic
qux = fg(201) + 'This is pink text using 8bit colors' + fg.rs
qui = fg(255, 10, 10) + 'This is red text using 24bit colors.' + fg.rs
# Add new colors:
fg.orange = ('rgb', (255, 150, 50))
buf = fg.orange + 'Yay, Im orange.' + fg.rs
print(foo, bar, baz, qux, qui, buf, sep='\n')
If neither work for you, I would look at this post for more options.
You can use any of the available libraries, but before you can use colored text, you need to run the following code.
>>> colorama.init()