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

Резултати

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

Пребарај: #total

当前筛选 #total清除筛选
CryptoBull_360™

@cryptobull_360 · Post #48600 · 03.03.2026 г., 13:47

#TOTAL crypto market cap has broken out of a symmetrical triangle pattern with strong volume confirmation. The Ichimoku Cloud is now acting as support, indicating underlying strength. A successful retest of the breakout level would likely confirm the move and fuel a bullish rally across the crypto market. However, if the retest fails, we could see price slipping back inside the triangle, leading to further consolidation. Keep monitoring the price action closely for confirmation..

Hashtags

Pro Analysis

@proanalysistrader · Post #28095 · 30.10.2024 г., 11:45

#TOTAL Analysis: The TOTAL crypto market cap has broken out of its downtrend. After the breakout, it retested the trendline and then broke through the previous swing high, suggesting a potential upward move in the coming days.

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #15576 · 31.01.2024 г., 12:53

#TOTAL MARKET CAP UPDATE : Total MarketCap moved a anticipated, Index dipped down into the support zone and rejected it strongly, also, Made a quick flip above the structural resistance zone now. Currently, a retest happening and need to see it hodling above the zone then a min-term rally in the market. In case of Daily again closing below then a short correction will hit the market again. By Crypto Australia

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #15408 · 22.01.2024 г., 13:00

#TOTAL MARKET CAP UPDATE : Index changed the market structure flipped the bearish, and given a close below too. Moreover, if we look into weekly TF, Weekly says some huge rejection past few weeks and this might be the final one. Well, overall now market kinda turning bearish, so better wait for the market to switch the direction before entering any sort of full positioning entries. Next Zone Index can reach will be $1.46T - $1.49T Support Area. By Crypto Australia

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #15340 · 19.01.2024 г., 10:42

#TOTAL MARKET CAP UPDATE : Marketcap still in a bullish market structure, in we'll see the top view. There are some minor breaks in below but still tend to be bullish. Well, price might again text the $750B Support zone before going up. We still have room for price to reach the Resistance area of $950B Mark. Attempting fresh trades would be not preferred. By Crypto Australia

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #14962 · 27.12.2023 г., 10:00

#TOTAL MARKETCAP UPDATE : Marketcap moving into the positive side and even though 4H given a close below of the support area of $1.59T - $1.60T, but Daily giving a close above and multiple wick rejections, showing bullishness. Well, a whole lot of push is anticipated towards the major resistance zone of $1.75T - $1.78T, where alts could fly smoothly. By Crypto Australia

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #14631 · 08.12.2023 г., 10:19

#TOTAL MARKETCAP UPDATE : #TOTAL MARKETCAP gone as per anticipated and pushed till the Resistance area around $1.46 - $1.48. Index flipped and retest the level and pushing. Well, its a already testing a resistance, but not a good one, so in coming Days/ Weeks we can see continuation towards the major Resistance area around $1.75 - $1.78. Currently, its looks like a tiny Head and Shoulder forming, so might gonna have a retracement a bit By Crypto Australia

Hashtags

Maximus Trade 🌕

@maximustrade1 · Post #7774 · 19.11.2023 г., 08:53

#TOTAL💭 ▪️Классно отрабатывают уровни и можно тем самым анализировать график биткоина по ТОТАЛу. ▪️Да, уровень 0.5 Фибоначчи всегда является магнитом. Как ни крути, цена всегда тестирует 0.5 фибо, так как, это является коррекцией падения с 69000$. ▪️Вопрос лишь в том, что произойдет раньше: тест 0,5 или 0,38? Сейчас мы стоим ровно в середине диапазона. Что будет первым? 0,382 - 🎃 0,5 - 🔥 LINK - Maximus Trade|TWITTER

Hashtags

Evening Trader Official

@eveningtrader_real · Post #6873 · 28.09.2025 г., 20:03

#TOTAL MARKET CAP ANALYSIS The total crypto market cap is rebounding from the support trendline of the symmetrical triangle, with the 100MA reinforcing this level as a key support. However, the Ichimoku Cloud remains a resistance barrier above the current price action. A decisive breakout above both the triangle and the cloud would confirm bullish momentum and open the door for further upside in the market.

Hashtags

CryptoNinjas Trading 🥷🏿

@cryptoninjastradingofficial1 · Post #5939 · 28.09.2025 г., 20:03

#TOTAL MARKET CAP ANALYSIS The total crypto market cap is rebounding from the support trendline of the symmetrical triangle, with the 100MA reinforcing this level as a key support. However, the Ichimoku Cloud remains a resistance barrier above the current price action. A decisive breakout above both the triangle and the cloud would confirm bullish momentum and open the door for further upside in the market.

Hashtags

Michaël Van de Poppe Official

@michaelvandepoppeanalyst · Post #4497 · 16.08.2024 г., 19:06

#TOTAL MARKET CAP ANALYSIS The total cryptocurrency market cap is consolidating within a bull flag pattern. It is currently trading below the Ichimoku Cloud, which is acting as a resistance barrier above the current price action. A breakout above the Ichimoku Cloud and the pattern's resistance trendline would provide strong bullish confirmation. Conversely, if the market cap breaks below the support trendline, the pattern will be invalidated.

Hashtags

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