Browse Source

Update 'README.md'

天问 1 year ago
parent
commit
8613871850
1 changed files with 32 additions and 0 deletions
  1. 32 0
      README.md

+ 32 - 0
README.md

@@ -1,2 +1,34 @@
 # colorama
 
+## Usage
+
+
+```
+from colorama import Fore, Back, Style, init
+
+# 初始化 Colorama
+init()
+
+# 打印带有颜色的文本
+print(Fore.RED + '红色文本')
+print(Fore.GREEN + '绿色文本')
+print(Fore.BLUE + '蓝色文本')
+
+# 恢复默认颜色
+print(Style.RESET_ALL + '恢复默认颜色')
+
+# 打印带有背景色的文本
+print(Back.RED + '背景红色文本')
+print(Back.GREEN + '背景绿色文本')
+print(Back.BLUE + '背景蓝色文本')
+
+# 恢复默认背景色
+print(Back.RESET + '恢复默认背景色')
+
+# 打印带有样式的文本
+print(Style.BRIGHT + '加粗文本')
+print(Style.DIM + '虚化文本')
+print(Style.NORMAL + '正常文本')
+print(Style.RESET_ALL + '恢复默认样式')
+
+```