狐狸.fox 2008-11-13 18:58 采纳率: 0%
浏览 762

终端打印用颜色?

How can I output colored text to the terminal, in Python? What is the best Unicode symbol to represent a solid block?

转载于:https://stackoverflow.com/questions/287871/print-in-terminal-with-colors

  • 写回答

27条回答 默认 最新

  • Didn"t forge 2008-11-13 19:06
    关注

    For Windows you cannot print to console with colors unless you're using the win32api.

    For Linux it's as simple as using print, with the escape sequences outlined here:

    Colors

    For the character to print like a box, it really depends on what font you are using for the console window. The pound symbol works well, but it depends on the font:

    #
    
    评论

报告相同问题?

悬赏问题

  • ¥15 C# 用partial定义部分类无法快速预览代码
  • ¥15 fastreport 代码无法设置最后一页横线不显示
  • ¥15 stm32u535芯片usb hid custom类接收数据有问题
  • ¥20 quartus功能仿真
  • ¥15 传染病最优控制问题,控制为什么没起作用
  • ¥15 ue5.3 pico打包失败 求帮助
  • ¥15 请教,这是用chatgpt写的CAD LISPD脚本,需求是画一个由双直线组成的矩形
  • ¥50 微信小程序 成功包奶茶啊
  • ¥15 计算机博弈的六子棋代码
  • ¥15 在Fetch API中传送的参数为何不起作用?