import pymysql,redis def op_mysql(host,user,password,db,sql,port=3306,charset='utf8'): conn = pymysql.connect(host=host,user=user, password=password, port=port, charset=charset,db=db) cur = conn.cursor(cursor=pymysql.cursors.DictCursor) cur.execute(s…