Ask coding questions

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


NikiArezehgar (1)

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

ash15khng (721)

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

Geocube101 (627)

@mathimo you can use termcolor as specified by

mathimo (12)

@Geocube101 yes but can you show me an example

Geocube101 (627)


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