TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Hashtags

Резултати

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

Пребарај: #rfkjr

当前筛选 #rfkjr清除筛选
Man in America 🇺🇸

@maninamerica · Post #2798 · 30.01.2025 г., 01:50

Billionaire Nicole Shanahan Puts Senate on Notice — “Dear U.S. Senators, Bobby may play nice; I won’t." The overwhelming support for RFK Jr.’s confirmation is just incredible. We The People are wide awake and will no longer allow #BigPharma to play their games. #MAHA#RFKJr

American Оbserver

@american_observer · Post #5146 · 15.02.2026 г., 22:59

📰 Make America Healthy (and Confused) Again Robert F. Kennedy Jr. has spent a year as Trump’s health secretary trying to turn a MAGA government into a Goop newsletter with subpoenas. He launched a “Make America Healthy Again” commission, blasted ultraprocessed food, and briefly terrified Big Ag by naming glyphosate and atrazine as “alarming” threats in kids’ blood — right up until farm‑state Republicans dragged him into the Roosevelt Room, the meeting turned heated, and his next report magically forgot pesticides exist. For a movement that promised to “take on poisoners,” it took one round of GOP table‑pounding to learn that, in this White House, corn and campaign cash are still a food group. Where Kennedy hasn’t backed off is vaccines. In a single year he’s purged CDC advisory panels, stacked them with skeptics, and hacked the childhood schedule down to a Denmark‑style list, dropping shots for hepatitis B, hepatitis A, rotavirus, flu, meningitis and Covid in the name of “informed consent.” Kids can technically still get the vaccines, but when the federal government stops recommending them, red‑state lawmakers hear it as an invitation to weaken school requirements, and measles and other preventable diseases are already resurging. Republicans who thought they were getting a culture‑war mascot now find themselves defending an HHS chief whose signature policy polls terribly even with Trump voters — 80‑plus percent say they want vaccine guidance from doctors, not influencers with Cabinet badges. Inside the system, RFK’s war on “captured” public health has just produced a different kind of capture. Research grants he doesn’t like get frozen or canceled; money is rerouted toward autism studies built around his vaccine theories; elite medical centers are punished in the name of “heartland” redistribution; and the NIH and FDA are yanked between right‑to‑try deregulation and sudden, selective purity tests on drugs and shots. One month, Kennedy’s FDA lieutenants slow novel approvals and try to pull a muscular dystrophy drug on safety grounds; the next, a political backlash gets his tough vaccine regulator briefly fired, then quietly rehired after a round of West Wing drama. The result isn’t principled rigor or principled libertarianism; it’s chaos — a health system jerked around by a secretary who can win a news cycle but can’t write durable law. Trump, for now, lets him run. RFK Jr. brings him a crossover brand, a wedge into wellness populism, and an army of MAHA loyalists the White House believes helped juice the 2024 vote. But every “win” Kennedy clocks — fewer vaccines, softer language on pesticides, a CDC too politicized for blue states to trust — is a policy that can be reversed in a memo the moment he’s gone, and a little more trust burned in the meantime. If year one was upheaval, year two is the test: does MAHA actually become Republican orthodoxy, or was this just a one‑term experiment in letting an anti‑establishment crusader redesign public health from inside the very machine he’s been promising to blow up? #usa#trump#RFKJr#health#vaccines#fakeDemocracy 📱American Оbserver - Stay up to date on all important events 🇺🇸

America 🇺🇸 News & Politics

@America · Post #10341 · 07.03.2026 г., 05:33

🚨🇺🇸DOCTORS SUE RFK JR OVER VACCINE OVERHAUL💉 🔹 Boston court hears challenge to HHS Secretary's new immunization schedule ⚖️ 🔹 Medical groups warn "unlawful changes" are causing measles spike (+1000 cases) 📈 🔹 DOJ lawyer argues RFK has "unreviewable authority" to set policy 🛡️ Public trust in health agencies is crumbling. Who do you trust? 🏥🤔 #USNews#health#vaccines#RFKJr#court

Dr Sherri Tenpenny

@SherriTenpenny · Post #24075 · 29.01.2026 г., 17:21

Finally, we are free from the WHO. In this week's Throwback Thursday, we take a look back at the WHO and everything they've done for us in the name of "health." https://drtenpenny.substack.com/p/tenpenny-throwback-thursday-4ae #tenpenny#WHO#gavinnewsom#newsom#rfkjr#throwback 🔹👉🏻@SherriTenpenny

IMPFOPFERARCHIV

@impfopferarchiv · Post #3381 · 11.01.2026 г., 09:51

Wichtige Unterstützung aus den USA – RFK Jr. äußert sich zur politischen Verfolgung von Ärzten und Patienten in Deutschland während COVID-19 Das große Interesse an der Videobotschaft von Robert F. Kennedy Jr. (über 2,5 Millionen Aufrufe in nur 11 Stunden) zeigt, wie sehr das Thema Corona-Aufarbeitung die Menschen weiterhin bewegt – nicht nur in Deutschland, sondern weltweit. Kennedy findet klare Worte: > “When any government criminalizes doctors for advising their patients, it crosses a line that free societies have always treated as sacred.” > „Wenn eine Regierung Ärzte dafür kriminalisiert, dass sie ihre Patienten beraten, überschreitet sie eine Grenze, die freie Gesellschaften immer als heilig betrachtet haben.“ Und weiter: > “A free society protects the right to think, the right to question, and the right to choose.” > „Eine freie Gesellschaft schützt das Recht zu denken, das Recht zu fragen und das Recht zu wählen.“ Diese Worte sind ein starkes Signal der Unterstützung – und ein Aufruf zur Ehrlichkeit. Danke an Robert F. Kennedy Jr. für seine klare Haltung und moralische Unterstützung aus den USA. Wir arbeiten weiter daran, dass dieses Kapitel unserer Geschichte vollständig, transparent und wahrhaftig aufgearbeitet wird – im Sinne der Grundrechte, der Menschlichkeit und der Wahrheit. Michael Ballweg #CoronaAufarbeitung#RFKJr#Grundrechte#Freiheit#Wahrheit#Meinungsfreiheit Quelle: https://x.com/SecKennedy/status/2009991504081678824?s=20