Python Forum

Full Version: package import issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I am a little Stuck!
I have successfully imported the package COLORAMA onto my system.
I have a test program that I have been playing around with. When I run it in the terminal, it works fine, bet when I try to use it in my IDE's shell (Thonny) it shows seemingly gibberish!

Here is my test program from the COLORAMA website:
from colorama import Fore, Back, Style

print(Fore.RED + 'some red text')
print(Back.GREEN + 'and with a green background')
print(Style.DIM + 'and in dim text')
print(Style.RESET_ALL)
print('back to normal now')
I am pretty sure that COLORAMA is only meant to colour the terminal but on the website: COLORAMA Website I interpreted it as you could colour the console.

I apologise if this question has been a waste of time and I am just being a spoon but any help would be appreciated.

Kind Regards,

Groovydingo.
you should check issues here: https://github.com/tartley/colorama/issues
if not already reported, report issue with author.
Thankyou,

I think it may just be a PEBKAC (Problem, Exists, Between, Keyboard and Chair). I will keep looking, and for the time being will use the terminal to run the program. It is mainly a convenience thing.

Thanks again.
(I think I will report it...)
(Oct-03-2018, 10:53 AM)groovydingo Wrote: [ -> ]Hi all,

I am a little Stuck!
I have successfully imported the package COLORAMA onto my system.
I have a test program that I have been playing around with. When I run it in the terminal, it works fine, bet when I try to use it in my IDE's shell (Thonny) it shows seemingly gibberish!
Fore.<color> is just a string that contains escape sequence supported by some terminals
Output:
In [5]: Fore.RED Out[5]: '\x1b[31m'
Obviously, Thonny terminal is not supported
Yea done some digging and that seems like the reason thanks! I won't bother to report as it is not that important.

Thanks.