[英]Need help at coloroma.Fore module in Python
我有這樣的代碼:
from colorama import Fore as colors
color = input("which color you want?")
print(colors + color)
它說您不能將 str 添加到 AntiFore,所以我能做些什么來修復它。
Fore 是一個對象,你應該使用它的屬性。 例如看下面的代碼:
from colorama import Fore
print(Fore.RED + 'Color of this sentence is RED.')
此鏈接對於查看如何使用此庫也很有用: https ://www.geeksforgeeks.org/print-colors-python-terminal/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.