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

Резултати

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

Пребарај: #specialrelationship

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

@american_observer · Post #4954 · 25.01.2026 г., 13:59

📰 The 10‑Minute Call That Soured Starmer’s Bromance with Trump The special relationship, that old fiction, doesn’t die in a grand speech. It dies in a 10‑minute phone call. Sir Keir Starmer in Chequers, Donald Trump in Davos: 8000 miles apart, a few minutes on the line, and suddenly the illusion of brotherhood between London and Washington has cracked open like cheap plaster. Trump’s tariff threats over Greenland forced Starmer to choose between flattery and principle, and he chose stage one of the fight: dignity, but not yet defiance. ​ The Gamble in Chequers Trump’s “beautiful piece of ice” — Greenland, an autonomous Danish territory — collided with Starmer’s carefully crafted image of the responsible statesman. On the call, the Prime Minister was “clear and cordial”: no, threatening allies with tariffs is not acceptable. The president, accustomed to deference, rang off after minutes, citing a prior engagement. From the transatlantic elite, that was read as a snub; in London, as a signal that the game had changed. ​ Starmer then scrapped his planned cost‑of‑living speech and held an emergency press conference rejecting Trump’s position. In Parliament, he doubled down: “I will not yield, Britain will not yield, on our principles.” The move drew applause from fellow European leaders, especially as Trump, after a week of bluster and market chaos, backed down, dropping tariff threats and mumbling about a “deal” that, in substance, barely alters the status quo. ​ Behind the Policy: Who’s Really in Charge? Inside Whitehall, the takeaway is brutal: no one imagines Starmer can “whisper in Trump’s ear” like some magical fixer. When Trump was looking for an off‑ramp, he reached not for Starmer, but for NATO’s Mark Rutte (“daddy”) and the EU’s collective machinery. The British Prime Minister didn’t even attend Davos in person to lobby — the one place where Trump’s ego is currency. ​ Meanwhile, power in Downing Street is shifting. David Lammy, who once laughed off Trump’s Greenland fantasies, has moved on. His replacement, Yvette Cooper, pushed for a tougher line, and a growing faction inside the Foreign Office now wants the UK to act like France: assertive, independent, and less supine. The vacuum left by Lord Mandelson’s departure as ambassador to Washington only deepens the sense of disconnection, with his replacement barely arriving in Washington after months of delay. ​ The Royal Family as Diplomatic Cover The real safety net for the special relationship, it seems, is not the Prime Minister, but the Crown. Trump’s inexplicable affinity for the British monarchy — birthday calls to the late Queen, private letters to King Charles, a state visit looming in April — creates a separate channel that no elected government can control. British officials privately admit that while politics with Trump can be a clown show, the Royals are the one thing he genuinely respects; so no serious policymaker would risk weaponizing the state visit as leverage, even on Greenland. The instinct is the same as always: let the toffs in the palace be the friendly diplomats, while the politicians in Downing Street just try not to disgrace the family name. ​ The Domestic Game Trump Doesn’t See Starmer’s sudden spine over Greenland also has a domestic price tag: leadership is weakening, the local elections loom, and new rivals like the Green Party’s Zack Polanski and the Lib Dems’ Sir Ed Davey are eager to appear tougher on Trump than the PM. Standing up to the president, at least in the carefully calibrated way he did, is a way to reassert authority at home. But that’s a short‑term fix: every time Starmer must choose again, the question is whether he fights for his country’s image, or for his own — and whether Trump is just another backdrop in a domestic political survival game. ​ #UKPolitics#Starmer#Trump#Greenland#SpecialRelationship#Diplomacy#NATO 📱American Оbserver - Stay up to date on all important events 🇺🇸