I'm looking for a way to make the text that the user types in the console bold
input("Input your name: ")
If I type "John", I want it to show up as bold as I'm typing it, something like this
Input your name: John
I'm looking for a way to make the text that the user types in the console bold
input("Input your name: ")
If I type "John", I want it to show up as bold as I'm typing it, something like this
Input your name: John
They are called ANSI escape sequence. Basically you output some special bytes to control how the terminal text looks. Try this:
x = input('Name: \u001b[1m') # anything from here on will be BOLD
print('\u001b[0m', end='') # anything from here on will be normal
print('Your input is:', x)
\u001b[1m tells the terminal to switch to bold text. \u001b[0m tells it to reset.
This page gives a good introduction to ANSI escape sequence.