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

Резултати

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

Пребарај: #popularpower

当前筛选 #popularpower清除筛选
Venezuelanalysis

@venanalysis · Post #1539 · 20.04.2024 г., 21:09

Sunday's countrywide vote will lead to the selection of 4,500 local projects that will be assigned US $10,000 each. Local organizations have held assemblies to identify the most pressing needs for communities. Read the full story here: https://venezuelanalysis.com/news/venezuela-national-popular-consultation-sees-voters-choose-state-funded-projects/ #Venezuela#Communes#PopularPower

Venezuelanalysis

@venanalysis · Post #1714 · 10.08.2024 г., 03:34

Robert Longa, a key cadre from El Panal Commune, discusses US interventionism and Venezuela’s participative and protagonistic democracy. Read the interview: https://venezuelanalysis.com/interviews/on-elections-and-collective-emancipation-a-conversation-with-robert-longa/ #Venezuela#Democracy#PopularPower

Venezuelanalysis

@venanalysis · Post #1869 · 04.02.2025 г., 21:10

🆕 NEWS | Venezuelans Vote in Third ‘National Popular Consultation’ to Select State-Funded Projects 🇻🇪 The grassroots electoral process was held in 5,334 communal circuits, where voters chose from over 36,600 proposals. Winning initiatives will receive USD 10,000 and be executed by grassroots collectives. The consultation is the first of six planned for 2025. 🔗 Read the full report here: https://shorturl.at/S90an #Communes#NationalPopularConsultation#PopularPower

Venezuelanalysis

@venanalysis · Post #2042 · 27.07.2025 г., 22:13

With today's electoral process winding down, VA's Cira Pascual Marquina files this report from the combative, working-class barrio 23 de Enero in western Caracas. Participation, as always in this Chavista bastion, has been positive throughout the day. #Venezuela#PopularPower#LocalElections

Venezuelanalysis

@venanalysis · Post #1885 · 20.02.2025 г., 20:23

🆕 NEWS | Maduro Presents Constitutional Reforms Package to Amplify Democracy and Chart ‘Sustainable’ Economic Course President Nicolás Maduro has introduced an 80-article constitutional reform proposal, emphasizing participatory democracy and a long-term economic roadmap. A National Commission has been formed to lead the process, and a public consultation will take place before a national referendum. A final proposal is expected in 90 days. 🔗 Read the full report here: https://shorturl.at/IVq9h #Constitution#NicolasMaduro#PopularPower

Venezuelanalysis

@venanalysis · Post #2046 · 29.07.2025 г., 20:06

🎙️ Episode 39 of the VA Podcast is out now! This episode examines the role of Venezuelan communes in socialist construction and anti-imperialist struggle, with guests Chris Gilbert and Cira Pascual Marquina. Both were guest editors of Monthly Review's latest issue, "Communes in Socialist Construction". The conversation covers the meaning of communes, Marx’s theory of the commune, and the political relevance of the slogan “Commune or Nothing!” 🎧 Watch here: https://youtu.be/u0RyfxgQgfc #Communes#PopularPower#VAPodcast#AntiImperialism#Venezuela

Venezuelanalysis

@venanalysis · Post #1830 · 13.12.2024 г., 13:59

Upcoming Elections in Venezuela: On Dec. 15, more than 4,000 communal circuits nationwide will host elections to select 30,000 peace judges. These officials, chosen through popular vote, will mediate community disputes and address local governance issues under newly reformed laws. Over 4,817 polling centers have been set up, and candidates present their plans in community assemblies and door-to-door campaigns. This initiative is part of Venezuela's broader efforts to advance grassroots democracy and participatory governance. Read the full report here: https://venezuelanalysis.com/news/venezuela-prepares-for-election-to-select-local-peace-judges/ #elections#participatorydemocracy#popularpower#communes

Venezuelanalysis

@venanalysis · Post #2347 · 25.04.2026 г., 20:21

🗒️🗣️ INTERVIEW | Heyerde López: ‘Our Challenge Is Staying True as a Left-Wing Organization’ In the latest VA interview, activist Heyerde López reflects on the structural challenges facing grassroots organizing in Venezuela, pointing to the difficulty of sustaining long-term projects while maintaining political coherence. López, a member of "Fundación Nativa Crea" in Guarenas, frames this as a central tension: “The main challenge is staying true to our identity as a left-wing organization,” he says, highlighting mounting economic pressures and contradictions in the relationship between popular power initiatives and state institutions. US sanctions and restrictions on wheat imports forced the closure of the group’s community bakery and café, key nodes in its local production network. The experience underscores how external constraints continue to impact grassroots economic initiatives. The collective is now working to relaunch these projects, with an emphasis on rebuilding communal forms of production and strengthening local productive capacity. Despite these setbacks, "Fundación Nativa Crea" remains embedded in broader networks of communes and social movements, while expanding its work in political education, communications, and grassroots production. Read the full interview here 👉https://venezuelanalysis.com/interviews/heyerde-lopez-our-challenge-is-staying-true-as-a-left-wing-organization/ #Art#Communes#NationalPopularConsultation#PopularPower

Venezuelanalysis

@venanalysis · Post #2037 · 24.07.2025 г., 19:41

📝 INTERVIEW | Building Communal Power from the Mayor’s Office: A Conversation with Lisbed Carolina Parada With municipal elections scheduled for Sunday, July 27, VA interviewed Lisbed Carolina Parada, mayoral candidate in the town of Urachiche, Yaracuy state. A longtime communal activist, Parada discussed the need to put institutional spaces at the service of popular power in the territories. Follow the link to read the interview: https://venezuelanalysis.com/interviews/building-communal-power-from-the-mayors-office-a-conversation-with-lisbed-carolina-parada/ #MunicipalElections#PopularPower#Urachiche#Communes

Venezuelanalysis

@venanalysis · Post #2083 · 01.09.2025 г., 18:13

📰 NEWS | Venezuela: Popular Organizations Push Direct Distribution Routes to Boost Food Security Pueblo a Pueblo and the Communard Union are providing affordable access to fish and vegetables by connecting popular organizations. Pueblo a Pueblo delivered 1,000 packs of fish and seafood, each weighing 3.8 kilograms, in Caracas, Yaracuy, Lara and Trujillo. The packages, sold at $13, represented savings of 50–60% compared to local markets. At the same time, the Communard Union transported 3.5 tons of vegetables from Trujillo to communes in Lara state. Between 500 and 600 people purchased potatoes, carrots, onions and tomatoes at prices around 40% below market levels. Both initiatives strengthen direct distribution routes between producers and communities. 🔗 Read the full report: https://shorturl.at/3HDgP #CommunardUnion#FoodSovereignty#PopularPower#PuebloaPueblo

Venezuelanalysis

@venanalysis · Post #1997 · 05.06.2025 г., 19:39

🖊 COLUMN | Venezuela, Popular Power and Coffee Jessica Dos Santos' latest column showcases how 18 communes in Sanare, Venezuela, launched the “Enriquito Colmenárez” coffee-roasting plant after receiving it from the Agriculture Ministry. The grassroots initiative supports campesinos with subsidies, training, and direct diesel access, while preparing to export robusta beans to the US and Russia. The plant will also host a soil lab through a partnership with the United Nations Food and Agriculture Organization (FAO). 🔗 Read the full VA column here: https://shorturl.at/EAU4t #Coffee#Peasants#Campesinos#PopularPower#TalesofResistance