Ask coding questions

← Back to all posts
how do we change the color of the text that input
mathimo (11)

abc

Comments
hotnewtop
NikiArezehgar (0)

ummm but how can you do the same thing but in javascript?

ash15khng (712)

You can use ANSI escape sequences. More info here.
You could also use termcolor for Python (and I think a few other languages)

Geocube101 (623)

@mathimo you can use termcolor as specified by
ash15khng.

mathimo (11)

@Geocube101 yes but can you show me an example

Geocube101 (623)

@mathimo

from termcolor import colored

user_input = input(colored(string, color))
#Where string is the prompt for the input command and color
#is a valid termcolor color

Valid termcolor colors can be found here