可能你们中的一些人都知道并且关于 shell 脚本 - tput
is 实用程序使用 terminfo 数据库来使 shell 可以使用终端相关功能的值和信息
在我的python脚本中,我有以下示例:(只是长代码中的一个示例)
for TOPIC in list:
if str(val) in TOPIC:
word = TOPIC.split()[1]
print ("Topic " + word + " is successfully configured")
else:
try:
word = TOPIC.split()[1]
print ("Topic " + word + " bad configuration")
except IndexError:
pass
我想在以下打印中将颜色从白色更改为绿色:
print ("Topic " + word + " is successfully configured")
或将颜色从白色更改为红色:
print ("Topic " + word + " bad configuration")
是否可以像我们在脚本中所做的那样更改颜色?python3
bash