摘要: python模块之re模块 注意:记得调用re模块 如果出错可能你的文件名也为re # 在python要想使用正则表达式必须借助于模块 # re就是其中之一 import re # re.findall re.findall('正则表达式','待匹配的文本') # 根据正则匹配出所有符合条件的数据 阅读全文
posted @ 2021-11-25 20:18 JasonBorn 阅读(495) 评论(0) 推荐(0) 编辑
摘要: collections模块 # 该模块内部提供了一些高阶的数据类型 1.namedtuple(具名元组) from collections import namedtuple ''' namedtuple('名称',[名字1,名字2,....]) res = namedtuple('名称,'名字1 阅读全文
posted @ 2021-11-25 20:13 JasonBorn 阅读(38) 评论(0) 推荐(0) 编辑
摘要: time模块 ''' 时间三种表现形式: 1.时间戳(距离1970至今的秒数) 2.结构化时间(一般是给机器看的) 3.格式化时间(一般是给人看的) 三种时间是可以相互转换的!! ''' 1.time.sleep(指定的秒数) # 原地阻塞指定的秒数 2.time.time() # 获取时间戳时间 阅读全文
posted @ 2021-11-25 20:05 JasonBorn 阅读(39) 评论(0) 推荐(0) 编辑