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

Резултати

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

Пребарај: #nifty50

当前筛选 #nifty50清除筛选
PRICE ACTION EXPERT

@priceactionexpert · Post #8871 · 28.03.2026 г., 10:55

https://x.com/i/status/2037845679603929594 #nifty Nifty clarification: Cycle 1 is supposed to go 27000 to 28800 which is valid as long as 23300 to 23900 above price stays Cycle 2: from top 27000 to 28800 it was supposed to drop massive Since 2024 the same happened nifty was leading and later dropped But in this case calculations vary once 23300 is broken everything changes After this crisis later it will be up and again down so we know 3 to 5 cycles if one dint reach the expected level Check all my previous posts if a level is missed especially if it's jackpot ot other it goes back So this phase mostly can drop u yil the 23900 holds simple as that. Once this drop is done later from it goes to 28800 or more which is way way advanced and ahead iam posting this may be after 2 to 4 years all will See without a doubt. Check as per market moves and use your own and combine and keep it simple I dont recommend or advice. It's merely my studies i post . #nifty50

PRICE ACTION EXPERT

@priceactionexpert · Post #8842 · 14.03.2026 г., 20:14

https://x.com/priceactiongann/status/2032731952021910011?s=20 #nifty Nifty 50 will go up massive upside 5500 points and more in upcoming weeks 23300 to 28800 in the very long term. One of the biggest bull trends is about to start Bookmark this post All the three defences 24507 , 23900, 23600 and last one where I used jackpot 1 year ago is reached now only at 23300 Look closely all the levels had a bounce first or low there and again breaches down The only level or calculation was missed and it took it's time and it's finally it's also done now #nifty50 Finally 23300 is most important and above it is upside and below it is downside. Most likely upcoming weeks will be up more 23300 will be historic for sure. 23300 above once the price goes there will be more up only. Everything is maths and geometry only.

PRICE ACTION EXPERT

@priceactionexpert · Post #7894 · 19.11.2024 г., 10:05

https://x.com/priceactiongann/status/1858813006051774858 #nifty50#niftycrash 23747 Exact Top and Drop as mentioned! was given weeks ago This exact level! instant drop almost 300 points! Nothing I give is random here! "We are what we repeatedly do. Excellence, then, is not an act, but a habit." follow on x posted there and support more on x https://x.com/priceactiongann/status/1858813006051774858

PRICE ACTION EXPERT

@priceactionexpert · Post #7924 · 27.11.2024 г., 14:53

https://x.com/priceactiongann/status/1861784516916035816 🚨"The Pause Before the Panic"🚨 Might not get a better chance to exit portfolio! #Sensex also pointing at 72000 from current price 80470 ! #nifty🛑Pray that 23300 holds 🛑, If breached, expect a non-stop decline. #nifty50 https://x.com/priceactiongann/status/1861784516916035816

PRICE ACTION EXPERT

@priceactionexpert · Post #7776 · 27.09.2024 г., 05:26

https://x.com/priceactiongann/status/1839536385474052306 #nifty 🎯 Last Week's High to Now: From the peak last week, we've seen a movement of about 400 points. 📉Nifty: Hit a short-term Level of 26,245. Gift Nifty: Reached 26,435.(Top level done) 🔄 Sensex & Nifty Alignment: Sensex at top now when reaches 84,544, Nifty is likely to follow suit. Synchronization: Both Sensex and Nifty hitting their respective highs simultaneously was noteworthy. 🕰📈 🏔 High Mark: Nifty's Exact High: 26,010 was the peak on that day, aligning perfectly with Sensex's timing. #nifty50#stocks#stockmarket

PRICE ACTION EXPERT

@priceactionexpert · Post #8231 · 07.04.2025 г., 04:06

https://x.com/priceactiongann/status/1897597854828671104?t= #niftycrash#nifty50 Historic significant price: All based on historic old price alone (No current market price I have used here) ALL TIME HIGH: 26277 from there we derived 21957 (21957+720=22677) Crucial zone: 157.5 x 144 =22680 156.5x144= 22536 History price 22222: 22222+432 22,654 ALL TIME HIGH: 26,277-4464 31x144 21,813 Numbers don't lie History in the making 👌❤️👌 Bookmark this and repost for maximum reach. #nifty#stockmarketcrash https://x.com/priceactiongann/status/1897597854828671104?t=

PRICE ACTION EXPERT

@priceactionexpert · Post #8124 · 06.03.2025 г., 10:41

https://x.com/priceactiongann/status/1897597854828671104?t= #niftycrash#nifty50 Historic significant price: All based on historic old price alone (No current market price I have used here) ALL TIME HIGH: 26277 from there we derived 21957 (21957+720=22677) Crucial zone: 157.5 x 144 =22680 156.5x144= 22536 History price 22222: 22222+432 22,654 ALL TIME HIGH: 26,277-4464 31x144 21,813 Numbers don't lie History in the making 👌❤️👌 Bookmark this and repost for maximum reach. #nifty#stockmarketcrash https://x.com/priceactiongann/status/1897597854828671104?t=

PRICE ACTION EXPERT

@priceactionexpert · Post #7862 · 02.11.2024 г., 13:19

https://x.com/priceactiongann/status/1852701540017987967 #nifty50#stockmarketcrash Nifty 50 Using Squares and Square Root: Recent cycle ends at 81 this is 2 times 81 which is 162 Time vibrations with price hidden. Starting Value: Square root of 26,277.35 ≈ 162.1028 Step 1: 162.1028 - 4 = 158.1028 Square of 158.1028 ≈ 24,996.52 Step 2: 158.1028 - 4 = 154.1028 Square of 154.1028 ≈ 23,747.703 Step 3: 154.1028 - 4 = 150.1028 Square of 150.1028 ≈ 22,530.880 Step 4: 150.1028 - 4 = 146.1028 Square of 146.1028 ≈ 21,346.057 can use as mentioned and check the circle perfection below!! #niftycrash#nifty https://x.com/priceactiongann/status/1852701540017987967

PRICE ACTION EXPERT

@priceactionexpert · Post #7856 · 01.11.2024 г., 05:02

https://x.com/priceactiongann/status/1852214204679242145 "Look deep into nature, and then you will understand everything better." — Albert Einstein #Nifty50#stockmarketcrash Nifty 50 Calculation Analysis and Cycles Recall: 1440+1440+1440=4320 Holy Trinity 3x144=432 26277-1440=24,837 26277-2880=23397 26277-4320=21,957! 4320 points from top is expected! Major high and low were given well in advance including long term cycles and short term as well. can check these and older posts! 23535 and 22222 is next and already 2000 plus points from top so expect more! #nifty#niftycrash

PRICE ACTION EXPERT

@priceactionexpert · Post #7618 · 16.07.2024 г., 03:44

https://x.com/priceactiongann/status/1813056880333262989 #nifty from 21300 to 24676 almost all upside is done! "THE END" of buy calculations after that lost motion or next movement will decide! price level is almost close and time is also up, when reaches encoded time is up , but as per time cycle course concept its date is in 2 days july 18 th so this week up to Monday will be high alert ! #stocks#GANN#stockmarket#nifty50

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