Похожие чаты

Hi guys, i have this problem: i want 2 python scripts

running at the same time: one receives queries and writes their data to some queue file
the other one reads the data, does some processing with the last query in the queue, which takes ~a minute or so (there may be a new query to be written during that period of time), and then clears the data it has processed, and starts the cycle again until the queue is empty.

the question is - what should the queue file be? i need some kind of a indexed database that can be operated by 2 files simultaneously? like a list but separated from the python files. the database doesn't even have to be key:value, but preferably index:value

i thought about using simple txt files but from what i've read about deleting lines and operating txt files it would be a total mess, since every approach caches lines in a list using readlines() but that would be a problem up-to-date reading and editing

4 ответов

4 просмотра

If you need a tiny database why not use something like sqlite?

artemetra 🇺🇦-[less active] Автор вопроса
Martin Rys
If you need a tiny database why not use something ...

i tried using redis for this and writing queries with indices by having an iterator variable in the database that i read to assign the keys for variables😅 obviously, it didn't turn out that well, so now i'm looking for a different db. from what i've read now i'm not sure how sqlite will be different. can i access its values just by indices?

artemetra 🇺🇦 [less active]
i tried using redis for this and writing queries w...

sure. you can. there is a rowid. sqlite is a database that you can save into a file too so you would essentially have a file that could also be version controlled (git or whatever)

Похожие вопросы

Обсуждают сегодня

Hi everyone! I have a two-folded message to share today. First: updates and news, as we are being asked for those. We still want to go like we did the last 6 years: we w...
Marten | Unibright.io
31
Happy Friday and happy CartesiWeekly! This week on the list: 🪲 Bug Buster Update 🎥 Erick de Moura’s interview with Ornella from Web3TV 👽 Thriving Cartesi alien 🇧🇷 SBRC hackat...
Nida | Cartesi - Never DM first or ask for funds!
1
Скажите, можно ли как-то "переместить" динамический массив из одной переменной в другую? Скажем, переместить из TList<> в TArray<>. Именно переместить, а не скопировать. Если ...
Eugene Krasnikov (ᴊɪɴ x)
37
Oh.... Admins at the main TG is already muted me. How many months Sir you muted me? Or forever if you are here @Janevietani @JohnnySonic
Charles Dar
28
Вот еще криповенькая штука. uMain.pas(517,3) Warning: Case statement does not handle all possible cases И ЧО? 😂
Александр (Rouse_) Багель
20
комрады, че-та лыжы не едут var tmpFont: TFont; begin tmpFont:= TFont.Create; try case rgFontColor.ItemIndex of 0: tmpFont.Color:= clWindowText; 1: tmpFo...
Ed Doc
34
.model small .stack 100h .data a db 'Hello, World!', '$' ; исходная строка b db 20 dup(?) ; строка b с запасом на максимальную длину .code main: ...
Алексей -man
3
Интересно, нет ли какого-то способа получить из dll не адрес самой метки, а адрес со смещением?
The Bird of Hermes
54
вопрос, кого посмотреть в ютубе или где почитать про указатели чтобы раз и навсегда запомнить зачем они нужны и как правильно ими пользоваться? поделитесь хорошими ресурсами, ...
-
14
М-да. Почему бы просто со stringlist не работать?
Michael Longneck
23
Карта сайта