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

Резултати

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

Пребарај: #snx

当前筛选 #snx清除筛选
Coin Sonar

@CoinSonar · Post #243517 · 17.04.2026 г., 07:49

#SNX | Volume spike (USDT PAIR) 67 times the average volume 107.06K USDT traded in 5 min └Selling vol: 69.96K USDT 🔴 Boost score: 1/10 24h Vol: 457.26K USDT (Binance) Price: 0.307 (-2.0% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28350 · 20.12.2024 г., 08:39

#SNX/USDT analysis : #SNX is currently retracing towards the support zone following a recent impulsive move. It is anticipated that after a breakout from this zone, the price will retest and subsequently bounce back, resuming its bullish momentum. TF : 1D Entry : $2.0 Target : $3.4 SL : $1.5

Hashtags

Pro Analysis

@proanalysistrader · Post #27938 · 16.09.2024 г., 14:02

#SNX/USDT analysis : #SNX has broken and retested the support zone, and it is currently facing resistance from the 200 EMA. The price is likely to continue its bearish momentum from its current level and retest previous lows. TF : 4H Entry : $1.353 Target : $1.229 SL : $1.430

Hashtags

American Crypto©

@americancryptotrading · Post #27461 · 06.12.2025 г., 10:17

🇺🇸#SNX/USDT is consolidating near the lowerborder of the descendingchannel on the weekly chart👀 Time to go long🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27429 · 05.11.2025 г., 09:26

🇺🇸#SNX/USDT is currently shaping the descendingchannel on the weekly timeframe💁‍♂️ Recovery is on the way✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27251 · 16.05.2025 г., 10:54

🇺🇸#SNX/USDT is about to break through the descendingchannel pattern on the daily timeframe🧐 Breakout is on the way🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27152 · 12.02.2025 г., 16:43

🇺🇸#SNX/USDT is facing the lowerborder of the falling wedge pattern on the weekly chart💁‍♂️ Looking for a rise📈 American Crypto©

Hashtags

Coinlegs Cryptocurrency Signals

@coinlegs · Post #9430 · 27.11.2023 г., 08:43

#SNX🐻👀 A little bit risky but will worth to try. Use SL. Want to see more strategies for any coin? Check out CoinLegs in order to have an overview before your trades 📊

Hashtags

Alphavave Traders ️️️

@alphavave · Post #2992 · 09.11.2025 г., 07:01

UNBELIEVABLE PROFIT OF 23,600% HAS BEEN REALIZED IN #SNX 🔀 We're made a massive 2️⃣3️⃣6️⃣🔤 profit this Trade 🤑🔥 If you had only $50 inthis single position you would've made $11,800⭐ Went from 7,910% to 23,615%—That’s an extra 15,705% profit just by holding for maximum gains🥂🔥 If you're someone who's been following our progress, but haven't yet joined the PREMIUM group, what's holding you back? You can see the consistent profits we're making on a regular basis. The only difference between you and the members who send us the positive feedback you see, is that they took action and joined the PREMIUM group. It's business as usual - every day, like clockwork, we are in the fast lane, leaving the competition eating our dust 😮‍💨🪙 If you are ready to step up, send me a message and let's get started 👇 @Kevindexter✅

Hashtags

Alphavave Traders ️️️

@alphavave · Post #2776 · 02.09.2025 г., 12:21

🔀#SNX/USDT 2,170% profit, insane move! 🤯 That’s 2️⃣1️⃣🔤 gain on your money 💰🔥 💰$50 would return $3600💸 💰$50 would return $1,085💎 💰$50 would return $1,085💎 Fast & solid results—that’s what we love the most. Any guesses on who’s missing out again? 🤔 Enjoy 2,170% profit🆙. 🤝Congratulations all Premium Members. Now imagine if you followed the rest of the signals.. 🤑💯 chat to join ➡️@Kevindexter✅️

Hashtags

ПретходнаСтраница 1 од 4Следна