Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
17

how do we change the color of the text that input

mathimo
mathimo

abc

4 years ago

Voters

Comments

TopNew
3
NikiArezehgar
NikiArezehgar

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

2 years ago
1
ash15khng
ash15khng

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

4 years ago
1
Geocube101
Geocube101

What Language?

4 years ago
1
mathimo
mathimo

@Geocube101
python3

4 years ago
1
Geocube101
Geocube101

@mathimo
you can use termcolor as specified by
ash15khng.

4 years ago
1
mathimo
mathimo

@Geocube101
yes but can you show me an example

3 years ago
1
Geocube101
Geocube101

@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

3 years ago
Load more