摘要: 本例开发一个菜谱点菜功能,可以输入菜名前的数字编号点菜。 import re option_str = input("请输入数字或方向键:") #re.sub(pattern,repl,string,count=0,flags=0)找到string中可以匹配pattern的部分, #然后将这些部分替 阅读全文
posted @ 2020-05-03 11:38 夏日的向日葵 阅读(1819) 评论(0) 推荐(0) 编辑
摘要: 在一些公共场所经常可以看到一些动态提示的文字,以下代码即为文字的循环变化代码: import sys import time def print_act(word): print('新春佳节快乐'+'\r') #让光标回到行首 sys.stdout.write("\r") #缓冲区的数据全部输出 s 阅读全文
posted @ 2020-05-03 11:34 夏日的向日葵 阅读(1790) 评论(0) 推荐(0) 编辑