Show Text in Color in REPL

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
blakebr
 
Posts: 942
Joined: Tue Apr 17, 2012 6:23 pm

Show Text in Color in REPL

Post by blakebr »

Hi,

Is there a way to show text in color on REPL? Such as:

Code: Select all

print("Ctrl-Code-Yellow" + "Hello AdaFruit" + "Ctrl-Code-White")
Bruce

User avatar
danhalbert
 
Posts: 4613
Joined: Tue Aug 08, 2017 12:37 pm

Re: Show Text in Color in REPL

Post by danhalbert »

It depends on the capabilities of the terminal program you are using. Some respond to the ANSI color escape codes: https://www.google.com/search?q=ansi+color+escape+codes

User avatar
neradoc
 
Posts: 542
Joined: Wed Apr 27, 2016 2:38 pm

Re: Show Text in Color in REPL

Post by neradoc »

Hi, there's a library for it in the community bundle:
https://github.com/s-light/CircuitPytho ... scape_code

JP just released a Circuitpython parsec on it:
https://www.youtube.com/watch?v=PcdxKl64uMo

User avatar
blakebr
 
Posts: 942
Joined: Tue Apr 17, 2012 6:23 pm

Re: Show Text in Color in REPL

Post by blakebr »

Thank You!

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”