遇事不决,可问春风,春风不语,谨遵本|

布都御魂

园龄:3年9个月粉丝:2关注:1

11 2023 档案

去除内容中的多余br标签
摘要:def br2_br1(content): content = re.sub('<br>(\s+)<br>', '', content) content = re.sub(r"(<br>)\1+", r"\1", content) content = re.sub("<br>", '<br><br>
39
0
0
取标签列表的最后两位,并去除最后一个逗号,没有标签就用标题
摘要:def update_biaoqian(tag_list, title): if tag_list == [''] or tag_list == []: print('没有标签,取标题作为标签') titless = re.sub('\s', ',', title) tag_list = title
10
0
0
把列表换成JSON格式,并根据键取值
摘要:def get_all(content, keyword): keys = [] values = [] for specs in keyword: num = keyword.index(specs) keys.append(specs) if num <= len(keyword) - 2: v
6
0
0
去除列表里的空格
摘要:def del_nt(title_list): title_new = [] for title_old in title_list: title = re.sub('\s', '', title_old) if title == '': pass else: title_new.append(ti
12
0
0
   
点击右上角即可分享
微信分享提示
深色
回顶
收起