摘要: import re data = """我始终!@@##¥%…………&alkjdfsb1234\n 566667是中国人woaldsfkjzlkcjxv123*())<> """ # 匹配所有汉字 print(re.findall('[\u4e00-\u9fa5]', data)) # 匹配所有单字 阅读全文
posted @ 2020-02-19 18:04 眼镜儿 阅读(11451) 评论(0) 推荐(1) 编辑
摘要: 以下代码将指定目录下的所有文件分类,按照后缀名归类存储 import os import shutil path = './' def foo(): files = os.listdir(path) for f in files: folder = path + f.split('.')[-1] i 阅读全文
posted @ 2020-02-19 14:08 眼镜儿 阅读(202) 评论(0) 推荐(0) 编辑