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

Резултати

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

Пребарај: #irantalks

当前筛选 #irantalks清除筛选
America 🇺🇸 News & Politics

@America · Post #10529 · 20.04.2026 г., 13:07

🇺🇸🇮🇷IRAN REJECTS SECOND ROUND OF PEACE TALKS AS US NAVAL BLOCKADE CONTINUES 🔹 Iran refuses to join Islamabad talks amid US blockade of Iranian ports — Trump team including JD Vance flew back empty-handed 🚢⛔ 🔹 Major sticking points: Iran wants 5-year nuclear pause, US demands 20-year suspension or complete dismantling program 🧨💥 🔹 Strait of Hormuz blockade continues until '100% complete deal' while Iran calls it ceasefire breach destroying trust 🌊🚨 Middle East powder keg getting more volatile by the day. Diplomacy or war — Trump's red line on nukes means force if talks fail 🔥💣⚖️ #IranTalks#MiddleEast#Diplomacy @america

American Оbserver

@american_observer · Post #5047 · 04.02.2026 г., 01:33

🚩🚩🚩🚩🚩 📰 Trump to Iran: “Bad Things” or a Deal — Pick One 🇮🇱 Israel’s Role: The Hardline Whisperer Israel, for its part, is playing the role everyone expected: the quiet but insistent voice in the ear of the U.S. Witkoff is expected to visit Prime Minister Benjamin Netanyahu and the Israeli military chief, with the understanding that Israel wants Washington to stick to Trump’s three demands — especially limits on Iran’s missile program and support for Hezbollah, Houthis and other Tehran‑backed groups. After the 2025 war, Israel already hit Iran’s nuclear sites, missile factories, and terror‑group infrastructure. It claims it “debilitated” Tehran’s regional proxies and degraded its nuclear and missile programs. Officials in Tel Aviv are under no illusions that diplomacy will erase Iran’s threat. They just want the U.S. to bake hard constraints into any deal — and be ready to back Israel militarily if the deal fails. Netanyahu put it in his own language in a speech to the Knesset: “Whoever attacks us will face serious consequences.” The message is clear: if the U.S. deal looks soft, the next big wave will be Israeli, not American. ⚔️ War or Theatre? The real decision in Istanbul is not about missiles or enrichment. It’s about who holds the trigger — and who looks like the one who tried to stop the war before the bombs went off. The U.S. wants a deal so it can claim the region didn’t explode. Iran wants a deal so it can say the West didn’t break the country’s back. Israel wants a deal that’s strict enough to justify not going it alone — and flexible enough to let it strike when it decides Washington bent the rules. If the talks fail, the “bad things” Trump promised may start: limited strikes, proxy escalations, an Iranian threat against Israel and U.S. troops in the region. If the talks “succeed,” the real question will be the same as last time: did the West manage the war, or just postpone it? #Iran#US#Trump#nuclear#diplomacy#Israel#missiles#protests#MiddleEast#IranTalks 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #5046 · 04.02.2026 г., 01:00

🚩🚩🚩🚩🚩 📰 Trump to Iran: “Bad Things” or a Deal — Pick One The U.S. and Iran are set to resume nuclear talks in Istanbul this Friday, and Donald Trump is already setting the script: “bad things” will happen if there’s no deal. On the other side of the table, the clerical regime in Tehran is quietly hoping that diplomacy works — not just to avoid American bombs, but to avoid the one thing that truly terrifies the leadership: a public that’s no longer afraid to rise up. Reports indicate that U.S. Special Envoy Steve Witkoff will meet Iranian Foreign Minister Abbas Araghchi in an attempt to revive a deal over Iran’s nuclear program before the region slides into a new war. Turkey, Qatar, Saudi Arabia, Egypt and other regional players are expected to join, turning the talks into a high‑stakes diplomatic show — the kind that looks like peace‑making but smells like bargaining with an armed regime. Trump, never one for nuance, has made it simple: a U.S. naval flotilla, including large warships, is heading toward Iran. “If we can work something out, that would be great,” he told reporters in the Oval Office. “If we can’t, probably bad things would happen.” Washington’s official line is that Tehran must accept three conditions: no enrichment of uranium, limits on its ballistic missile program, and an end to support for regional proxies. Iran has rejected all three as violations of its sovereignty, but sources say the regime is actually more worried about its missiles than about enrichment. The clerical rulers see the ballistic program as the core of their deterrence, not just a side project of the nuclear file. 🔥 Iran’s Deeper Fear: The Streets, Not the Bombs The real vulnerability for Tehran is not the U.S. Navy, but the streets inside Iran. Last month, a brutal crackdown on anti‑government protests left the regime deeply shaken. Intelligence and security officials have told Supreme Leader Ayatollah Ali Khamenei that the “wall of fear” may have collapsed. Many Iranians, they say, are ready to confront security forces again, and a limited U.S. strike could be the spark that turns unrest into open rebellion. One official put it bluntly: an attack combined with mass demonstrations could lead to a collapse of the ruling system. That’s the real concern at the top of the pyramid — and the reason the regime is quietly signaling that it’s ready to make some concessions on uranium, including handing over several hundred kilograms of enriched material and accepting a zero‑enrichment arrangement under international supervision. The price: U.S. warships and planes move away from Iran’s borders before talks start. “Now the ball is in Trump’s court,” an Iranian official told Reuters. From this angle, Tehran is not just negotiating for sanctions relief. It’s trying to buy political survival — the kind of survival that depends less on centrifuges and more on whether the public stays in the streets or organized in online protest networks. #Iran#US#Trump#nuclear#diplomacy#Israel#missiles#protests#MiddleEast#IranTalks 📱American Оbserver - Stay up to date on all important events 🇺🇸