码迷,mamicode.com
首页 >  
搜索关键字:findall    ( 707个结果
python爬千千音乐
模拟浏览器,访问互联网资源,根据所写的规则,下载所需的音乐数据! 源代码查看:在更多工具里的开发者工具(shift+ctrl+I 或f12) 在谷歌浏览器中登入千千音乐 http://music.taihe.com 在pycharm写代码 在Terminal中输入pip install reques ...
分类:编程语言   时间:2018-08-16 00:47:36    阅读次数:138
python模块汇总练习
1、random模块 2、模拟打印进度条 3、shelve模块(序列化) 4、xml模块 2018-08-15 22:54:40 ...
分类:编程语言   时间:2018-08-16 00:38:12    阅读次数:208
c# linq 汇总
例子:List<string> list = new List<string>(); list.Add("1 a");list.Add("2 b");list.Add("3 c");list.Add("4 d");list.Add("5 e"); 添加元素: 一:List.Add(T item) 如 ...
分类:Windows程序   时间:2018-08-14 17:49:55    阅读次数:340
re模块
import re# print(re.findall('\w','ab 12\+- *&_')) ['a', 'b', '1', '2', '_']# \w# print(re.findall('\W','ab 12\+- *&_')) [' ', '\\', '+', '-', ' ', '*'... ...
分类:其他好文   时间:2018-08-14 15:43:28    阅读次数:170
xml模块
import xml.etree.ElementTree as ettree = et.parse('a.xml')root = tree.getroot()print(root)#三种查找节点的方式#(1)查找节点的方式 root.iter('year')res = root.iter('year ...
分类:其他好文   时间:2018-08-13 21:24:23    阅读次数:157
转义符,re模块,rangdom随机数模块,
# 正则模块 # 转义符 # r' ' # re模块 # findall search match # sub subn split # compile finditer # 分组在re中的应用 取消分组的特殊性 (?:正则) # findall 优先显示分组中的内容 # split 保留分组中的内 ...
分类:其他好文   时间:2018-08-09 17:37:32    阅读次数:183
正则表达式
import re# ret1 = re.findall("\d","1987adfa324244") #获得一个列表# print(ret1)# 练习 # ret1 = re.findall("\d+","181ddhdhd28287228fhdhd2727")# print(ret1)## # ...
分类:其他好文   时间:2018-08-07 22:22:13    阅读次数:144
re模块
# re模块 # findall (查找所有符合正则表达式的字符, 以数组的形式返回) #例子: #import re #ret = re.findall('\d+','123123asd123') # 括号内是参数 第一个是定义的表达式, 第二个是需要处理的字符串 ... ...
分类:其他好文   时间:2018-08-07 22:22:07    阅读次数:180
re模块
常用的方法 findall / search / match / compile / finditer sub subn split import re findall, search, match re.match只匹配字符串的开始,如果字符串开始不符合正则表达式,则匹配失败,函数返回None;而... ...
分类:其他好文   时间:2018-08-07 21:27:39    阅读次数:142
re模块和分组
1. findall search match (查找,匹配) findall方法括号内参数 正则,字符串, 返回值是一个列表,匹配不到返回[] 空列表 如 > ret = re.findall('\s+','kjewhfqho254qfewgf') print(ret) search 方法括号内参 ...
分类:其他好文   时间:2018-08-07 18:57:10    阅读次数:141
707条   上一页 1 ... 30 31 32 33 34 ... 71 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!