摘要:
import re # 判断是否包含英文 str = "text文本" contain_en = bool(re.search('[a-z]', str)) if contain_en: print("包含英文字符") else: print("不包含英文字符") 阅读全文
posted @ 2019-09-13 15:26
Jumpkin1122
阅读(6344)
评论(0)
推荐(0)
摘要:
import random # 读取文件中的每行的单词保存到列表 lines = open("data/voc01.txt", encoding="utf-8").read().split("\n") # 打乱每行的顺序 random.shuffle(lines) 阅读全文
posted @ 2019-09-13 15:22
Jumpkin1122
阅读(731)
评论(0)
推荐(0)