AttributeError: module 'pymysql' has no attribute 'escape_string'
AttributeError: module 'pymysql' has no attribute 'escape_string'
问题
AttributeError: module ‘pymysql’ has no attribute ‘escape_string’
代码
# coding:utf-8
import pymysql
# ....
s = r'sss'
ss = pymysql.escape_string(s)
解决
# coding:utf-8
import pymysql
from pymysql.converters import escape_string
# ....
s = r'sss'
ss = escape_string(s)
本文链接:https://choudalao.com/article/241
转载请注明来源,感谢尊重原创内容。
留言评论
支持表情、回复和点赞。评论需要先登录。