【发布时间】:2016-05-25 20:53:25
【问题描述】:
print("hello")
输出应该是单词“hello”,但带有下划线。
【问题讨论】:
标签: python printing console underline
print("hello")
输出应该是单词“hello”,但带有下划线。
【问题讨论】:
标签: python printing console underline
您可以使用转义字符来做到这一点。
print("\033[4mhello\033[0m")
【讨论】:
你可以输入
print("\u0332".join("你好")) 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)
【讨论】:
确保你有 python3 解释器 然后运行
x="the solution"
print("\033[4m" + x + "\033[0m")
【讨论】:
这肯定会奏效:
print("\u0332".join("hello "))
【讨论】:
确保您拥有 Python 3.6+ 使用 pip 安装 quo https://pypi.org/project/quo
from quo import echo
echo(f"Hello World!!!", underline=True)
【讨论】: