赞
踩
python下sqlite3替换某字段多个特殊字符问题
import sqlite3
con=sqlite3.connect(‘m3u8db’)
cursor=con.cursor()
cursor.execute(‘update links set srclink_f=”https://m3u8.cdnpan.com/” || substr(srclink,28) || “.m3u8”’)
con.commit()
for i in (“\”,”/”,”:”,”*”,”?”,”\”“,”<”,”>”,”|”):
sql=”update links set tpc_f=replace(tpc,?,’_’)”
cursor.execute(sql,(i,))
con.commit()
cursor.close()
con.close()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。