摘要: 1、匹配整数或者小数(包括正数和负数) # ret=re.findall('-?\d+(?:.\d+)?','3132.3') # # print(ret) 2、匹配年月日日期 格式2018-12-6 # ret=re.findall('[1-9]\d{0,3}-(?:1[0-2]|0?[1-9])-(?:3[01]|[12]\d|0?[1-9])','2018-12-6') # print(r... 阅读全文
posted @ 2018-11-15 17:01 Python张梦书 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 一.昨日回顾 #__file__查看当前文件所在的绝对路径 #time 时间模块 time.time 获取当前时间戳时间 字符串->time.strptime->结构化->mktime->时间戳 时间戳->gmtime.localtime->结构化->strftime->字符串(格式化) #rand 阅读全文
posted @ 2018-11-15 15:00 Python张梦书 阅读(194) 评论(0) 推荐(0) 编辑