Python 彩色終端輸出

from colorama import init, Fore, Back, Style


if __name__ == "__main__":
    init(autoreset=True)    #  初始化,並且設置顏色設置自動恢復
    print(Fore.RED + 'some red text')
    print(Back.GREEN + 'and with a green background')
    print(Style.DIM + 'and in dim text')
    print('back to normal now')
發佈了36 篇原創文章 · 獲贊 8 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章