print("hello")
The output should be the word "hello", but underlined.
You can do it by using escape characters.
print "\033[4mhello\033[0m"
You may type
print("\u0332".join("hello ")) enter image description here
string = 'Hello world'
emptystring = ''
for i in range(0, len(string)):
if string[i] == ' ':
emptystring = emptystring + string[i]
else:
emptystring= emptystring+string[i]+str('\u0332')
print(emptystring)
来源:https://stackoverflow.com/questions/35401019/how-do-i-print-something-underlined-in-python