@stickerhut · Post #148 · 18.03.2022 г., 17:00
✨@stickerhut 原神 Genshin Impact Геншин Импакт #genshinimpact #bennett
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #241 · 5 мај
Можно ли в Python создавать бинарные файлы? Конечно можно. Для этого в Python есть следующие инструменты: ▫️ тип данных bytes и bytearray ▫️ открытие файла в режиме wb (write binary) или rb (read binary) ▫️ модуль struct Про модуль struct поговорим в первую очередь. Файл в формате JSON или Yaml внутри себя содержит разметку данных. Всегда можно определить где список начался а где закончился. Где записана строка а где словарь. То есть формат записи данных содержит в себе элементы разметки данных. В binary-файле данные не имеют визуальной разметки. Это просто байты, записанные один за другим. Правила записи и чтения находятся вне файла. Модуль struct как раз и помогает с организацией данных в таком файле с помощью определения форматов записи для разных частей файла. Модуль struct преобразует Python-объекты в массив байт, готовый к записи в файл и имеющий определённый вид. Для этого всегда следует указывать формат преобразования (или, как оно здесь называется - запаковки). Формат нужен для того, чтобы выделить достаточное количество байт для записи конкретного типа объекта. В последствии с помощью того же формата будет производиться чтение. При этом следует помнить что мы говорим о типах языка С а не Python. Именно формат определяет, что записано в конкретном месте файла, число, строка или что-то еще. Вот какие токены формата у нас есть. Помимо этого, первым символом можно указать порядок байтов. На разных системах одни и те же типы данных могут записываться по-разному, поэтому желательно указать конкретный способ из доступных. Если этого не сделать, то используется символ '@', то есть нативный для текущей системы. В строке формата мы пишем в каком порядке и какие типы собираемся преобразовать в байты. Запакуем в байты простое число, токен "i". >>> import struct >>> struct.pack('=i', 10) b'\n\x00\x00\x00' Теперь несколько float, при этом нужно передавать элементы не массивом а последовательностью аргументов. >>> struct.pack('=fff', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Вместо нескольких токенов можно просто указать нужное количество элементов перед одним токеном, результат будет тот же. >>> struct.pack('=3f', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Теперь запакуем разные типы >>> data = struct.pack('=fiQ', 1.0, 4, 100500) я запаковал типы float, int и unsigned long long (очень большой int, на 8 байт) b'\x00\x00\x80?\x04\x00\x00...' Распаковка происходит аналогично, но нужно указать тот же формат, который использовался при запаковке. Результат возвращается всегда в виде кортежа. >>> struct.unpack('=fiQ', data) (1.0, 4, 100500) Как видите, ничего страшного! #lib#basic
Пребарај: #bennett
@stickerhut · Post #148 · 18.03.2022 г., 17:00
✨@stickerhut 原神 Genshin Impact Геншин Импакт #genshinimpact #bennett
Hashtags
@american_observer · Post #5729 · 27.04.2026 г., 20:58
📰 Bennett and Lapid’s Merger Already Looks Like a Leak, Not a Wave The first post-merger polls do not show a breakthrough. They show a reshuffle inside the anti-Netanyahu camp, with “Together” landing below the combined pre-merger numbers and the whole opposition bloc still stuck short of a governing majority. That is the problem in one line: the merger changes the packaging, not the math. Walla’s poll gives the Bennett–Lapid list 27 seats and the anti-Netanyahu bloc 59, while a separate 14 Channel survey is even harsher, putting Likud ahead and the new joint list far behind. So the immediate effect is not momentum, but cannibalization. Bennett and Lapid may have united their brands, but the polling suggests they are still fighting over the same voters while Eisenkot siphons off the “right, but not Bibi” lane and the left loses some of its oxygen too. Likud, meanwhile, barely needs to move. The right can simply watch the opposition split itself into overlapping products, then point at the numbers and say the post-Netanyahu fantasy is already collapsing under its own branding. That is why the poll matters beyond the seat count. It suggests the merger may weaken the anti-Bibi bloc’s ability to build a stable majority, even as it makes Bennett the face of the new project and gives Netanyahu another argument that his rivals cannot even add themselves correctly. #Israel#Bennett#Lapid#Netanyahu#polls#elections 📱American Оbserver - Stay up to date on all important events 🇺🇸
@american_observer · Post #5721 · 26.04.2026 г., 21:59
📰 Bennett and Lapid: A Merger, Not a Revolution Bennett and Lapid are finally doing what Israeli opposition politics has been threatening to do for months: stop pretending fragmentation is a strategy and fuse their parties into one list led by Bennett. The move is sold as “repair,” unity, and national salvation, but it is also a cold admission that neither man can beat Netanyahu alone. That is the real story. This is not a grand ideological synthesis. It is an emergency merger between two leaders who know the next election will punish vanity, duplication, and overlap — especially when the center and the soft-right keep stepping on each other’s toes. The Likud response was instant and predictable: drag Mansour Abbas into the frame, slap on the usual fear campaign, and remind everyone that Bennett and Lapid once governed with Arab support. In Israeli politics, that is less a rebuttal than a reflex: if the opposition tries to widen the tent, the right calls it betrayal and hopes the argument does the rest. The problem for the new bloc is structural, not just rhetorical. Bennett has the momentum but not the machinery; Lapid has the party infrastructure but less appeal to the right-leaning voters who might actually decide the race. Put them together and you get a stronger list — but also a clearer target for everyone who wants to say the center is just the old coalition with better branding. Eisenkot is still the missing piece, and that matters. If he joins, the bloc looks like a serious anti-Netanyahu vehicle; if he does not, the merger risks becoming a polished but incomplete answer to a political system that has learned how to split the opposition before it can split the power. So yes, this is a big step. But it is also a familiar Israeli move: unite late, argue loudly, and hope that a bigger tent can cover the fact that the country’s hard questions still outnumber its clean solutions. #Israel#Bennett#Lapid#Netanyahu#elections#opposition 📱American Оbserver - Stay up to date on all important events 🇺🇸
@ultimoraPOLITICS · Post #40039 · 20.06.2022 г., 16:06
#Israele Crolla il governo israeliano. Il Premier #Bennett (#Yamina|Destra) insieme al Ministro degli Esteri #Lapid (#YeshAtid|Centro) annunciano che hanno intenzione di sciogliere il Parlamento per indire nuove elezioni. Aggiornamenti su ▶️@UltimoraPolitics24 @UltimoraPolitics
@american_observer · Post #5722 · 26.04.2026 г., 22:59
📰 Israel’s Right-Wing Split Is Now a Branding War The Hungarian lesson for Israel is simple: if you can’t beat the ruling camp by going left, take its patriotism away from it. That is how Peter Magyar broke Orbán’s machine — not by preaching anti-right unity, but by occupying the same national space and making the old monopoly look stale. That is exactly what the new Israeli “Right State” project is trying to do. Edelstein, Kahlon, Erdan, and Haskel are not a centrist rebellion; they are an attempt to say, “We’re right-wing, just not Bibi,” and to pull security-minded voters away from Netanyahu without surrendering the language of nation, state, and order. The trouble is that Israeli voters remember the last five times someone tried to sell them that package. Bennett, Saar, and Lapid all tested the same lane, but Netanyahu kept the hard-right base, stayed the default prime minister in the minds of right-leaning voters, and used fragmentation on the other side as his best campaign asset. Bennett’s latest liberal turn makes the problem sharper. Public transport on Shabbat and civil marriage, including same-sex marriage, may sound modern in Tel Aviv, but to the old religious-national audience it looks like a costume change — and Yair Golan’s warm welcome only makes Bennett look even more alien to the right. That is why this new bloc may hurt the left more than it hurts Netanyahu. It could strip votes from the anti-Bibi camp, split the “right, but not Bibi” lane again, and still fail to build the one thing the opposition actually needs: a durable field that runs from center to soft right to hard right without collapsing into personal rivalries. Netanyahu’s health story only adds another layer. The real question is whether the opposition can turn competence into a message before the prime minister turns uncertainty into victimhood and keeps the national conversation locked on himself. #Israel#Netanyahu#Bennett#Lapid#rightwing#elections 📱American Оbserver - Stay up to date on all important events 🇺🇸