摘要: 1. collections模块 (1)namedtuple # (1)点的坐标 from collections import namedtuple Point = namedtuple('point',['x','y']) # 前两行可以用下面两行代替 # import collections 阅读全文
posted @ 2018-10-08 22:30 xc_718 阅读(241) 评论(0) 推荐(0) 编辑
摘要: re模块 1. 匹配常用方法 (1) findall 返回值:列表:列表中是所有匹配到的项 import re ret = re.findall('a','eva egon yuan') #['a', 'a'] print(ret) ret = re.findall('[a-z]+','eva eg 阅读全文
posted @ 2018-10-08 21:16 xc_718 阅读(144) 评论(0) 推荐(0) 编辑