Похожие чаты

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 ответов

22 просмотра

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)

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта