TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #239 · 3 мај

Один из самых удобных способов записать данные это использование готовых форматов, такие как JSON или YAML. Из плюсов такого подхода стоит отметить вот что: 🔸 готовый, повсеместно используемый и поддерживаемый формат 🔸 простой и понятный файл, удобочитаемый для человека 🔸 можно легко редактировать в любом текстовом редакторе без специальных программ и библиотек Но есть и минусы 🔹 затраты времени при записи файла (кодирование данных в нужный формат строки) 🔹 затраты времени при чтении файла (декодирование данных в Python объекты) 🔹 размер файла увеличивается из-за разметки данных (скобки, запятые, переносы, отступы...) 🔹 перед записью все данные должны быть помещены в память в полном объёме (не всегда) 🔹 при чтении необходимо считать весь файл в память и только потом декодировать данные Если нужно писать немного данных в несколько файлов, то затраты по времени не ощутимы. Обычно это файлы конфига или какие-либо метаданные. Это отличный вариант под такие задачи. Есть и другой поход к записи файлов - это бинарные файлы. Используется, когда данных достаточно много и никто их не собирается читать глазками😳. 🔸 очень быстрая запись 🔸 чтение значительно быстрей чем JSON, YAML итд 🔸 размер файла значительно меньше, так как нет разметки 🔸 можно записывать данные по мере поступления не загружая всё в память 🔸 можно извлечь любую часть данных независимо Из минусов 🔹 нужно определить свой формат записи данных (если не используете готовую спецификацию определённого формата) 🔹 не получится открыть файл и визуально понять что там записано, а для чтения файла потребуется знать его спецификацию. 🔹 не так-то просто создать такой файл без специальной библиотеки В таком виде удобно записывать большой массив любых однородных данных. Например, мониторинг валютной биржи или кэшированная анимация 3D геометрии. (Это не означает что нельзя записать данные разного типа, просто это будет не так удобно) Представьте себе JPG-картинку. По сути это немного мета-информации и большой массив пикселей. Тоже самое со звуком или видео файлом. Поэтому, если вы попробуете открыть картинку в текстовом редакторе вы увидите что-то вроде такого f15d cd29 a564 4578 ... 09e2 9bc4 a696 1253 ... 84e9 4de1 3b23 c24a ... 2534 5161 28e0 709d ... ... Это и есть записанные байтики. И для их чтения требуется определённый софт который знает что с ними делать. Под каждый тип файла. К чему это я? Читайте в следующем посте... #tricks#basic

Резултати

Пронајдени 8 слични објави

Пребарај: #communalresistanceseries

当前筛选 #communalresistanceseries清除筛选
Venezuelanalysis

@venanalysis · Post #1579 · 24.05.2024 г., 16:20

The Pancha Vásquez Commune in Apure State, Venezuela, focuses on cattle rearing and agriculture. Despite private land ownership limiting their capacity, they’ve established a Collection and Distribution Center to aid local producers. Discover how communards in the Venezuelan plains region [Llanos] produce, organize, and resist the impact of the US blockade. Click here to read the full interview 👉🏼shorturl.at/qfmo6 #communalresistanceseries

Venezuelanalysis

@venanalysis · Post #1589 · 31.05.2024 г., 20:54

Llaneros Resist the Blockade! Facing severe impacts from the US blockade, the Pancha Vásquez Commune has innovated with communal exchanges and local production shifts, such as using buffalo for dairy due to higher yield. The new Collection and Distribution Center aims to reduce intermediary dependency and stabilize food prices. Click here to read the full interview 👉🏼shorturl.at/T9XD6 #communalresistanceseries#sanctions

Venezuelanalysis

@venanalysis · Post #1632 · 05.07.2024 г., 19:56

The Coporo Indígena community in Apure, Venezuela, maintains its traditions and communal land practices despite violence and the US blockade. Recently, they welcomed 18 families displaced by violence, showing the strength of their communal ties. 'In Pumé society, we all work together and share the little that we have: shelter, water, and other goods, while the care of the community and the land is everybody’s task,' said Gladys García, spokesperson for the Coporo Indígena Communal Council. Read more in the full interview, part of the communal resistance series, here 👉🏼shorturl.at/uLjEo #communalresistanceseries#indigenouspeoples

Venezuelanalysis

@venanalysis · Post #1593 · 07.06.2024 г., 17:35

The Pancha Vásquez commune in Apure State, Venezuela, consisting of fourteen communal councils, embodies the region's deep-rooted traditions in agriculture and cattle rearing. It's also where Hugo Chávez sharpened his political vision from 1985-1988, intertwining his socialist ideals with the local folklore. From the legendary “El Silbón” to “La Sayona,” the tales Chávez encountered in Elorza have become a vital part of the area's folklore, reflecting the enduring impact of his legacy. Read the full interview here 👉🏼shorturl.at/jaxwE #communalresistanceseries#communes#HugoChavez

Venezuelanalysis

@venanalysis · Post #1786 · 25.10.2024 г., 19:00

Amazonian Huo̧ttö̧ja̧ People and the Bolivarian Process The Río Cataniapo Commune showcases the strength of Indigenous organizations in the Venezuelan Amazon, with approximately 1,500 participants committed to communal living and traditional agriculture. 'Our way of living is far more communitarian than the sabari way of life,' notes Irene Pérez, of the 5 de Julio-Las Pavas Communal Council, is an artisan and campesina, emphasizing their commitment to ensuring no one goes hungry. Read the full interview here: https://venezuelanalysis.com/general/amazonian-huo%cc%a7tto%cc%a7ja%cc%a7-people-and-the-bolivarian-process-rio-cataniapo-commune-part-ii/ #VAInterview#communalresistanceseries#communes#indigenouspeoples

Venezuelanalysis

@venanalysis · Post #1802 · 08.11.2024 г., 21:22

In the Río Cataniapo Commune, communal power and tradition intersect to sustain food sovereignty and resist the impacts of the US blockade. The commune produces its staple casabe from yuca, managing every step from harvest to market. Read the full interview here 👉🏼https://shorturl.at/WRgF9 #VAInterview#communalresistanceseries#communes#indigenouspeoples#communalandworkingclassresistance

Venezuelanalysis

@venanalysis · Post #1779 · 18.10.2024 г., 21:44

‘The Commune Is Nothing New Here’: The Rio Cataniapo Commune The Rio Cataniapo Commune, located in the Venezuelan Amazon, brings together 1,500 people, mainly Indigenous, to protect the Cataniapo River and develop a sustainable agricultural economy. As Enrique Martínez, a Huo̧ttö̧ja̧ leader, explains: ‘Self-government and collective ownership are part of our heritage.’ Indigenous leadership remains key, but the community also seeks modern improvements while preserving tradition. Read the full interview here 👉🏼https://shorturl.at/Xgst1 #VAInterview#communalresistanceseries#communes#indigenouspeoples#communalandworkingclassresistance

Venezuelanalysis

@venanalysis · Post #1649 · 12.07.2024 г., 14:25

In the Venezuelan plains region, a multi-generational group of women works to build Bolivarian socialism amid the US blockade. Nacidos para Vencer con Chávez [Born to Triumph with Chávez] is a women-led commune in a rural context with a long history of patriarchal oppression. This fledgling commune seized upon Chávez’s idea as a way forward in difficult times, attempting to build community and increase production, while connecting with other communes through the Communard Union. Read the full interview as part of the VA Communal Resistance Series 👉🏼shorturl.at/r06V5 #communalresistanceseries#communes#communalresistance#workingclassresistance