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

Резултати

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

Пребарај: #silver

当前筛选 #silver清除筛选
Wolf of Trading®

@wolfoftrading · Post #6029 · 13.03.2026 г., 19:28

Silver just dropped below $80! The largest on-chain#silver short, 0x007d, holds 148,359 xyz:SILVER ($11.88M) and is now up $2.23M.

Hashtags

🔅SILVER Is Very Bearish! Sell!📉 - - - - - - - - Please, check our technical outlook for 📊SILVER. The price is testing a key resistance 5,871.4. Taking into consideration the current market trend & overbought RSI, chances will be high to see a bearish movement to the downside at least to 5,754.1 level. - - - - - - - - #freesignal#silver - - - - - - - - 🌐Free Copy Trading: Link 📲Join VIP via Bot:Link ❓Official Contact:@signalprovidercontact

🔅SILVER Will Move Higher! Long!📈 - - - - - - - Please, check our technical outlook for 📊SILVER. The market is trading around a solid horizontal structure 5,642.3. The above observations make me that the market will inevitably achieve 6,175.7 level. - - - - - - - - #freesignal#silver - - - - - - - - 🌐Free Copy Trading: Link 📲Join VIP via Bot:Link ❓Official Contact:@signalprovidercontact

🔅SILVER Will Grow! Long!📈 - - - - - - - Here is our detailed technical review for 📊SILVER. The market is testing a major horizontal structure 5,240.5. Taking into consideration the structure & trend analysis, I believe that the market will reach 5,614.1 level soon. - - - - - - - - #freesignal#silver - - - - - - - - 🌐Free Copy Trading: Link 📲Join VIP via Bot:Link ❓Official Contact:@signalprovidercontact

PRICE ACTION EXPERT

@priceactionexpert · Post #8861 · 23.03.2026 г., 11:27

https://x.com/priceactiongann/status/2036042034608509042?s=20 #silver Silver one of the major prices encoded holds 63.00 to 62.00 intermarket cycles can range in between and if price further breaks down only will take it down deeper #gold one market cycle is one way and finding cycles in both and relating them can give further confirmations 1.speed is very fast and volatile in one direction almost risk is on sentiment 2. gold also reaches 4090 and 4320 which coincides with silver 63 which is 9x7 3.both bounces and forms low which gives further delay on this current sell trend 4.more downsides should break this low further and gold current low near 4090 5.when end of intermediate cycles it forms such levels and we use them and combine to deduce more than what to do and what not to do 6. in this case what should not be done is clear as one part is done, we cannot keep looking for further down unless low is broken again 7.knoweldge with proper understanding of cycles is key to all when in slight doubt in one direction i avoid and be cautious Always study and confirm it never trade on hope and fear when not clear avoid and study further there is opportunity always save your capital is your first rule.

Hashtags

PRICE ACTION EXPERT

@priceactionexpert · Post #8853 · 19.03.2026 г., 14:28

#gold Massive drop can happen! Gold dropped and broken 4631 and went down and again comes back to retest So there would be a high and massive drop can come from here if this level holds #silver retest should be at 69.5 which is current price both Drop can take to 63 to 64 if this high holds Watch out here ! Just follow the intensity until the price goes up as within the above region of 4675. https://x.com/priceactiongann/status/2034636669102735711?s=20

Hashtags

PRICE ACTION EXPERT

@priceactionexpert · Post #8841 · 13.03.2026 г., 15:49

https://x.com/priceactiongann/status/2032484028490948913?s=20 #Gold Gold from 5225 top cycle it's been anchored to drop from there dropping nicely so far next drop was hinted at 5120 and it's where exactly it formed high and retest also accurate to the point there only 5121.00 drops on top to 5080 and next 5050 done with slight bounce confirming the levels breaking further lows next can to 5000 and 4949 only use studies and analysis and combine with yours use multiple confluences side by side and combine with silver cycle #silver levels are key, use that too and check both instruments where the levels meet and use those for our advantage always Its all-pure maths and geometry only! Do share and repost max so many can benefit. thanks.

Hashtags

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