There was a question in adding objects to the database. When executing this code
#создаю словарь из атрибутов(head) и значений(lines) b = dict(zip(head, lines[i].replace('"', "").split(","))) #создаю json объект jsonarray = json.dumps(b, ensure_ascii=False) # на выходе получается, например ({"id": "666", "name":"вапв'аы"пы"}) #добавляю в базу json объект в виде сырой строки cursor.execute("""INSERT INTO events (data) VALUES (%r);""" % jsonarray) I get an error in quotes in the "vapwy" line. How can I escape this correctly so that I can insert the database into the database and then use SELECT to get the selection and send it as JSON?