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

Резултати

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

Пребарај: #sd

当前筛选 #sd清除筛选
American Crypto©

@americancryptotrading · Post #27617 · 11.05.2026 г., 13:43

🇺🇸#SD Volumes are huge🔥 Bullish rally is coming✈️ Stader isn’t trying to be another hype project. They’re building actual staking infrastructure across multiple chains👀 $SD American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27601 · 26.04.2026 г., 14:16

🇺🇸#SD accumulating at the huge volumes🔥 Bullish🐃 People chase hype. Smart money looks at structure. Stader (SD) has: less supply + real revenue flow That matters 🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27504 · 15.01.2026 г., 13:01

🇺🇸#SD Cyclical pump is playing✈️ Do not miss $SD while it's still at the dip🔥 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27494 · 06.01.2026 г., 13:50

🇺🇸#SD keeps to its Cycle✔️ Bear Trend is over❌Bullish Trend Started✅ MACD crosses the mid-lne as well as its signal line crossed for bullish🐃 Stader keeps staking flexible instead of locking funds. At the same time, $SD completed its buyback just yesterday🧱 https://etherscan.io/address/0xefe40ff167a89ce3babdad161d41d798ca7116b2#tokentxns American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27485 · 29.12.2025 г., 12:34

🇺🇸#SD This chart keeps repeating the same story. Sharp sell-off → momentum drains → aggressive upside leg follows. Price is now sitting right at that transition point again. 🧩 Downside move looks complete, and the curve is starting to turn — this is where new trends are born, not extended lower. 📉➡️📈 If history rhymes, the next phase is a strong expansion move. Buybacks coming soon 🔥 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27453 · 28.11.2025 г., 13:02

🇺🇸#SD Price has completed another clean rounded bottom formation at the lower boundary of the long-term structure. The reaction from this zone is strong and mirrors previous cycle reversals. 🔥 Each prior rounded bottom led to a powerful upside expansion, and the current setup is replicating the same rhythm with high precision. The structure shows clear exhaustion of sellers and a decisive shift in momentum. ⚡️ With the pattern repeating and demand stepping in aggressively, price is now positioned for a sustained bullish continuation toward higher macro levels. The next leg up is not just likely—it’s expected. 🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27371 · 10.09.2025 г., 15:24

🇺🇸#SD/USDT Bullish Flag on weekly🐃 Looking for the retest of the MajorSupplyZone and more upside in case of a breakout🚀 Stader fundamentals keep improving — scaling TVL, expanding volumes, and consistent demand from both LST and Cabbage. This aligns with the key catalyst → buybacks roll out next week. American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27217 · 15.04.2025 г., 13:28

🇺🇸#SD/USDT Good recovery on $SD ☝️ Once we are back above the red support, send it✈️ Fundamentals: Stader released cabbage (sign for waitlist to be the first to try) + 500k coins bought from the market😎 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27190 · 20.03.2025 г., 11:31

🇺🇸#SD/USDT Falling wedge below the resistance zone🧐 Expecting a retest of the one and breakout📈 Much Awaited Stader Quarterly Buyback happening this week - Add the fact there are no unlocks after March🔥 $SD is going full deflationary! American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27089 · 19.12.2024 г., 15:11

🇺🇸#SD/USDT Low + Higher Low We are going to break that resistance🚀 $750mln in TVL New product cabbage is coming out + Binance List added $SD American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27065 · 28.11.2024 г., 15:41

🇺🇸#SD/USDT We got a fakeout below the symm. triangle and now breaking out of the one📈 Whitepaper will be released at 4th December | $SD is only $50mln MC still early🔥 American Crypto©

Hashtags

Michaël Van de Poppe Official

@michaelvandepoppeanalyst · Post #4720 · 02.09.2024 г., 13:29

#SD Accumulating structure remains unchanged️ I keep accumulating! Stader buybacks 286.2k SD ($150k) off CEXs - at this rate almost 3.5% circulating supply annualised will be bought from the market BULL️

Hashtags

123•••1011
ПретходнаСтраница 1 од 11Следна