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

Резултати

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

Пребарај: #dodik

当前筛选 #dodik清除筛选
American Оbserver

@american_observer · Post #5691 · 23.04.2026 г., 14:00

The War Between the EU and the US Is Real Than Never The EU risks a confrontation with Trump after it sought to stall the awarding of a lucrative Balkans pipeline contract to a company fronted by his personal lawyer, documents seen by the Guardian show. Brussels has clashed with Trump over trade, Ukraine and military spending, but the intervention in the Southern Interconnection pipeline project appears to mark the first time it has challenged a commercial venture by those close to the president. The pipeline will run through Bosnia and Herzegovina. Under what Bosnian sources say have been months of pressure from US officials, its leaders have been moving quickly to award the contract to a previously little-known company based in Wyoming. AAFS Infrastructure and Energy was incorporated in November last year and has not disclosed its owners. It is fronted by two leading members of Trump’s campaign to overturn his 2020 election defeat : Jesse Binnall, a lawyer who defended him against allegations of inciting the Capitol riots after his defeat, and Joe Flynn, the brother of the president’s former national security adviser. Despite lacking any apparent track record, AAFS is planning to invest $1.5bn in the pipeline and other Bosnian infrastructure projects, its local representative has said. In March, lawmakers approved legislation that Transparency International said would set a “dangerous precedent” by stipulating that the contract must go to AAFS without a tender. Days later, Brussels’ representative in Sarajevo delivered a private warning to Bosnia’s leaders that they were jeopardising the country’s hopes of joining the EU. In a letter sent on 13 April, obtained by the Bosnian investigative outlet istraga.ba and seen by the Guardian, the EU official Luigi Soreca wrote that, under an energy agreement between Bosnia and Brussels, it was “crucial that draft laws are thoroughly coordinated” with the EU. Soreca said Brussels should have a say in the pipeline legislation. “In this way, Bosnia and Herzegovina can continue to progress on its European path and avoid missing out on opportunities for further integration, as well as financial opportunities,” he said. Binnall has said the pipeline is a “priority for the Trump administration”. Asked about the EU’s intervention, he said: “AAFS will never lose sight of what truly matters in this project: delivering energy security and fostering economic development for the people of Bosnia and Herzegovina. We are committed to working closely with all relevant authorities to develop the infrastructure needed to make this vision a reality.” By connecting Bosnia to a liquefied natural gas terminal off the Croatian coast, the pipeline would allow US gas to reach a country that depends on Russia for its entire supply. After Putin launched Russia’s full-scale invasion of Ukraine in 2022, Brussels set a deadline for EU members – plus aspiring members, such as Bosnia – to stop buying Russian gas by 2028. Nonetheless, Brussels faces the prospect of a crucial new piece of Europe’s energy chessboard falling under the control of not just a US company, but one personally connected to an antagonistic president. Binnall and Flynn are not the only ones from Trump’s circle to have shown an interest in Bosnia. Joe Flynn’s brother Michael – a former US intelligence chief whose conviction for lying to the FBI about his dealings with Russia was quashed by a pardon from Trump in 2020 – has been lobbying for the head of Bosnia’s Serb nationalist faction. The lobbying campaign succeeded in October in having US sanctions lifted from Milorad Dodik, the Bosnian Serb leader who has been undermining the 1995 peace accord that ended a three-year war in which more than 100,000 people were killed. In April, Donald Trump Jr, who runs the family business empire, visited Sarajevo. Although neither he nor Michael Flynn appear to be directly involved in the pipeline project, Dodik has thrown his support behind it. #trump#dodik#gaz 📱American Оbserver - Stay up to date on all important events🇺🇸

Tutto Elezioni

@tuttoelezioni · Post #1390 · 23.11.2025 г., 10:02

#BosniaErzegovina🇧🇦 #RepublikaSrpska #Presidenziali 🗒Breve panoramica della Republika Srpska La Repubblica Serba (Republika Srpska) è una delle due entità che compongono la Bosnia ed Erzegovina, insieme alla Federazione di Bosnia ed Erzegovina. Nata dagli Accordi di Dayton del 1995, è l’area in cui è maggioritaria la popolazione serba di Bosnia (nella Federazione si concentra la popolazione croata e bosgnacca). Il centro amministrativo della Repubblica è Banja Luka. La Republika Srpska è politicamente dominata da partiti nazional-conservatori serbi, in particolare l’Alleanza dei Socialdemocratici Indipendenti (#SNSD|Nazionalisti serbi russofili) di Milorad #Dodik, e i rapporti con il governo di Sarajevo sono spesso tesi, soprattutto sul tema dei poteri delle istituzioni centrali e dell’Alto Rappresentante. Le elezioni nell’entità hanno sempre un impatto significativo sull’equilibrio complessivo della Bosnia ed Erzegovina. ❓Come si vota? Per le elezioni presidenziali, è previsto un unico turno ed è eletto Presidente il candidato che ottiene il maggior numero di voti. Il mandato dura 4 anni. @TuttoElezioni