A
A
Artyom Nikiforov2020-07-13 16:12:18
Python
Artyom Nikiforov, 2020-07-13 16:12:18

Is it possible to add a tuple to a sqlite3 database?

Hello.
There is a dictionary (just a random example) Is it possible to add it to sqlite3? The table has two columns: id and words.
mydict = ['Друг', 'Брат']

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2020-07-13
@teacoder

Convert the dictionary, or whatever you have... - to json - and store it in a text field in a sqlite table . Do the
opposite when reading.
Or you can use pickle to convert to a byte sequence - and store it in a blob type field, and do the reverse operation when reading.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question