字体样式
回忆上次内容


- 从3到10 又是什么效果 呢??
- 真的可以blink闪烁吗?👁
3m

4m


控制范围

print("\033[0mthis is an \033[4manchor\033[0m")
print("\033[0mthis is \033[4man anchor\033[0m")
print("\033[0mthis is\033[4m an anchor\033[0m")
属性叠加
- 先变亮(\033[1m)、再加下划线(\033[4m)
- 先加下划线(\033[4m)、再变亮(\033[1m)
- 效果一样


- 变暗 也可以 与下划线叠加
- 可以 简化控制序列 吗?
简化写法

VT100

- 很多东西 都可以 从VT100看出端倪
- 4m是 下划线
- 5m呢?
继续尝试

快闪

import time
for i in range(1000):
if i % 2 == 0:
print("\roeasy",end="")
else:
print("\r ",end="")
time.sleep(0.2)
7m


8m

9m


字体设置


20-29

效果


专门清除


29m以后

总结
- m 可以改变字体样式
- 0-9 之间设置的都是字体效果
- 0 重置为默认
- 1 变亮
- 2 变暗
- 3 斜体
- 4 下划线
- 5 慢闪
- 6 快闪
- 7 前景背景互换
- 8 隐藏
- 9 中划线
- 叠加效果
- 取消效果
- 21 取消 1
- 22 取消 2
- 23 取消 3
- 一直到 29
- 0 是全部取消,回到默认

- 最后发现
- 我们下次再说!👋
- 蓝桥->https://www.lanqiao.cn/courses/3584
- github->https://github.com/overmind1980/oeasy-python-tutorial
- gitee->https://gitee.com/overmind1980/oeasypython
- 视频->https://www.bilibili.com/video/BV1CU4y1Z7gQ 作者:oeasy