Похожие чаты

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

20 просмотров

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)

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

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

30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
Also, why can’t the community have a vote/ say when it comes to initiatives like buybacks. Isn’t the point of crypto decentralisation? Don’t we deserve input as long term supp...
👨🏽‍🦰
13
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
Привет)) уже кажется эту тему перемусолили, но вот я так и не понял. Я сейчас сижу на 27дюймов 2к мониторе. На Актуальной макоси, если я куплю 27д 4к монитор: - будет ли изобр...
Vladislav Piskunov
15
any reference of this implementation?
BitBuddha
29
Hi guys, any problem with Pulsebrige? Trying to transfer from wETH to ETH. First it tells me to connect my metamask "through mobile app" not desktop. Then I did and confirmed ...
Snowflakecrypto
13
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
13
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
Карта сайта