Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 tcl 中有一些输出,使用 puts 打印,如下所示:
puts "hello world"
我们可以用不同的颜色打印相同的东西吗?
您需要使用ANSI Escape 序列
例如,以粗体红色打印线条:
puts -nonewline "\033\[1;31m"; #RED puts "My RED String" puts -nonewline "\033\[0m";# Reset