2017年12月4日

python strip()

摘要: Grammar: Python strip() 方法用于移除字符串头尾指定的字符(默认为空格)。 参数 chars -- 移除字符串头尾指定的字符。 返回值 返回移除字符串头尾指定的字符生成的新字符串。 Case: quote:http://www.runoob.com/python/att-str 阅读全文

posted @ 2017-12-04 17:07 sub2020 阅读(150) 评论(0) 推荐(0) 编辑

2017年12月1日

python 正则表达式 re.sub & re.subn

摘要: Grammar: 使用repl替换string中每一个匹配的子串后返回替换后的字符串。当repl是一个字符串时,可以使用\id或\g、\g引用分组,但不能使用编号0。当repl是一个方法时,这个方法应当只接受一个参数(Match对象),并返回一个字符串用于替换(返回的字符串中不能再引用分组)。cou 阅读全文

posted @ 2017-12-01 14:24 sub2020 阅读(3552) 评论(0) 推荐(0) 编辑

2017年11月30日

python 正则表达式 re.findall &re.finditer

摘要: 语法: findall 搜索string,以列表形式返回全部能匹配的子串 finditer 搜索string,返回一个顺序访问每一个匹配结果(Match对象)的迭代器 Case: Output quote:http://cuiqingcai.com/977.html 阅读全文

posted @ 2017-11-30 16:18 sub2020 阅读(557) 评论(0) 推荐(0) 编辑

python 正则表达式 re.split

摘要: 内置函数split与re库中的split,有很多相似处 Output: 阅读全文

posted @ 2017-11-30 15:27 sub2020 阅读(1077) 评论(0) 推荐(0) 编辑

2017年11月29日

python 正则表达式 re.search

摘要: Output: quote:http://cuiqingcai.com/977.html 阅读全文

posted @ 2017-11-29 16:17 sub2020 阅读(4502) 评论(0) 推荐(0) 编辑

python 正则表达式 re.match

摘要: Output: quote:http://cuiqingcai.com/977.html 阅读全文

posted @ 2017-11-29 15:40 sub2020 阅读(633) 评论(0) 推荐(0) 编辑

python正则表达式

摘要: 写了部分代码,测试各个表达式的含义 有点烦,我想,这样的机械性工作完全可以用List或是字典,循环完成的。可惜我还没怎么学过 以后会把另一半的测试补全 Output: quote:http://cuiqingcai.com/977.html 阅读全文

posted @ 2017-11-29 11:15 sub2020 阅读(148) 评论(0) 推荐(0) 编辑

2017年11月24日

Learn Python the hard way, ex45 对象、类、以及从属关系

摘要: 没有写别的 阅读全文

posted @ 2017-11-24 13:48 sub2020 阅读(190) 评论(0) 推荐(0) 编辑

2017年11月22日

Learn Python the hard way, ex42 物以类聚

摘要: 依然少打很多剧情,并修改了很多,还好,能运行 Output: 阅读全文

posted @ 2017-11-22 10:12 sub2020 阅读(266) 评论(0) 推荐(0) 编辑

2017年11月21日

Learn Python the hard way, ex41 来自Percal 25 号星星的哥顿人

摘要: 我承认,我偷懒了,少打了大量代码(剧情),英文太差,下次可以编个中文的试试 Output: 阅读全文

posted @ 2017-11-21 15:40 sub2020 阅读(348) 评论(0) 推荐(0) 编辑

导航