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

Резултати

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

Пребарај: #vainterview

当前筛选 #vainterview清除筛选
Venezuelanalysis

@venanalysis · Post #1813 · 22.11.2024 г., 21:43

Cooperation Jackson is a coop-based organization working for Black self-determination and economic democracy in Jackson, Mississippi. Activist and writer Kali Akuno is one of the project’s founders. In the latest VA interview, Akuno discusses his long-standing relationship with the Bolivarian Revolution and his efforts to build connections between the revolutionary process in Venezuela and the work that is being done in Mississippi. Read the full interview here 👉🏼https://shorturl.at/nwm4z #internationalsolidarity#sanctions#VAInterview

Venezuelanalysis

@venanalysis · Post #1860 · 24.01.2025 г., 19:04

Along the Orinoco River, fishing has long been a way of life rooted in collective work and respect for nature. Under the US blockade, fisher folk in the Ayacucho Commune are addressing challenges with ingenuity and solidarity. From boat rotations to crafting curiaras together, they are building resilience and self-governance while working toward food sovereignty. As José Flores, the state coordinator of fisher folk for the Ayacucho Commune, says, "the river brings us together." 🔗 Read the full report here 👉🏽https://shorturl.at/4OGYk #VAInterview#CommunalandWorkingClassResistance#Communes

Venezuelanalysis

@venanalysis · Post #1855 · 17.01.2025 г., 17:46

In Puerto Ayacucho, Ayacucho Commune fisherfolk combines tradition with communal organization to counter the effects of US sanctions. To secure food sovereignty, they plan to build a refrigeration facility to bypass exploitative intermediaries. As José Flores, state coordinator of fisher people for the Ayacucho Commune, said: 'Fishing is more than work; it binds the community together.' Learn more in VA’s latest Communal Resistance series interview: https://venezuelanalysis.com/interviews/the-ayacucho-commune-a-fishing-community-on-the-orinoco-part-i/ #VAInterview#CommunalandWorkingClassResistance#Communes

Venezuelanalysis

@venanalysis · Post #1737 · 06.09.2024 г., 23:10

Located near Miraflores Palace in Caracas, La Minka Collective operates from a dynamic multi-use cultural space. The building, a former printing press, is adorned with a mural representing Venezuela’s popular history and now hosts classrooms, a radio studio, and a community kitchen, each dedicated to advancing grassroots democracy. In the latest VA interview, Natalia Molina, a founder of the organization, reflects on La Minka’s origins, its cultural projects, and the collective’s work in building a socialist commune while defending the Bolivarian Process after the post-July 28th fascist attacks. Read the full interview here: https://shorturl.at/qoEqK #Communes#Culture#VAInterview

Venezuelanalysis

@venanalysis · Post #1766 · 04.10.2024 г., 17:20

In the latest VA interview, Javier Couso, a keynote speaker at the recent World Congress Against Fascism in Caracas discussed the fascist attacks on Venezuela. He highlighted Venezuela’s resistance to fascist tactics by liberal democracies, marking it as a key player in the global struggle for sovereignty and democracy. 'Venezuela is a beacon in the fight for sovereignty and true democracy,' stated Couso. Read the full interview here 👉🏼https://shorturl.at/Ej6UL #VAInterview#Fascism#PresidentialElections2024

Venezuelanalysis

@venanalysis · Post #1940 · 18.04.2025 г., 19:48

📝 INTERVIEW | Venezuela’s 2025 Elections, Electoral Safeguards and Constitutional Reform: A Conversation with Oliver Rivas In the latest VA interview, Deputy Oliver Rivas breaks down the 2025 candidate selection process, rooted in grassroots assemblies and internal evaluations, and explains how the Simón Bolívar Law protects Venezuela’s democracy from foreign interference. He also looks ahead to the upcoming constitutional reform, which aims to enshrine the commune in the nation’s charter. 🗣 “The process opens a national debate on the type of state we want.” 📖 Read the full interview here: https://venezuelanalysis.com/interviews/venezuelas-2025-elections-electoral-safeguards-and-constitutional-reform-a-conversation-with-oliver-rivas/ #2025ConstitutionalReform#LegislativeRegionalElections2025#VAinterview

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 #1838 · 20.12.2024 г., 23:46

Cuban theologian Joel Suárez reflects on Hugo Chávez’s integration of spirituality into his leadership, noting his embodiment of a grassroots liberation theology that combined political vision with cultural expressions like baseball and music. Read the full interview here 👉🏽https://venezuelanalysis.com/interviews/chavez-spirituality-and-celebration-a-conversation-with-joel-suarez-part-ii/ #Chavez#religion#VAInterview

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 #1749 · 20.09.2024 г., 21:13

Ximena González Broquen, a social scientist leading a center at Venezuela’s prestigious Institute for Scientific Research (IVIC) and compiler of several essay collections, discusses the Ethics of Liberation as a framework that challenges the top-down, market-driven logic of conventional scientific research institutes in the latest VA interview. She advocates for a more democratic research environment while aiming to build bridges with organized communities. Read the full interview here 👉🏼https://shorturl.at/PHqTf #VAInterview#Revolution#science#interview

Venezuelanalysis

@venanalysis · Post #1556 · 10.05.2024 г., 21:03

On Fascism and Other Maladies: A Conversation with Luis Britto García One of Venezuela’s most respected intellectuals talks about fascism and corruption scandals in the lead-up to the presidential elections. Read the full interview here 👉🏼shorturl.at/cexUZ #VAInterview#LuisBrittoGarcia#Venezuela#presidentialelections2024#interview#corruption#fascism