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

Резултати

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

Пребарај: #optionstrading

当前筛选 #optionstrading清除筛选

🐠 Kingfisher traders, wanna snag the BIGGEST $BTC fishes? 🐦 Use the GEX "sonar" chart, and look at the options whales! 🔵 Blue water = Calm fishing, easy gains. 🔴 Red water = Choppy, risky dives. ⚪️ Clear water? ⚠️ Big moves brewing, watch for any change in weather! #BTC#GEX#CryptoTrading#OptionsTrading

DWF Labs Broadcast

@DWFLabs · Post #343 · 21.06.2023 г., 13:52

BIT Exchange has launched the world’s 1st #ADA/USD #OptionsTrading🥳 ▫️Denominated & settled in USD ▫️1-10x leverage ▫️Available on web, mobile app & API ▫️More #altcoin options are coming We are excited to be part of this strategic collaboration with BIT and Darley Technologies to make #ADAOptionsTrading possible ✨ Read more here.

Bounty Hunters 💎

@trustedairdropsss · Post #2697 · 07.06.2025 г., 04:49

🚀 Booked ₹1.37+ Lakh Profit! 💰 Another great day in the markets with smart entries & exits. 📈 Check out the power of precision trading! 🔥 🧠 Join my private trading community for real-time insights, setups, and mentorship. Whether you're new or experienced — you’ll level up fast. 👇 Click to join now 🔗https://t.me/+7emcw1k0H_U4ZDg9 📊 Stay ahead, trade smart. 💯 #BankNifty#OptionsTrading#StockMarketIndia#TradeLab#Profits

Bounty Hunters 💎

@trustedairdropsss · Post #2696 · 06.06.2025 г., 14:07

🚀 Booked ₹1.37+ Lakh Profit! 💰 Another great day in the markets with smart entries & exits. 📈 Check out the power of precision trading! 🔥 🧠 Join my private trading community for real-time insights, setups, and mentorship. Whether you're new or experienced — you’ll level up fast. 👇 Click to join now 🔗https://t.me/+7emcw1k0H_U4ZDg9 📊 Stay ahead, trade smart. 💯 #BankNifty#OptionsTrading#StockMarketIndia#TradeLab#Profits

Bounty Hunters 💎

@trustedairdropsss · Post #2695 · 06.06.2025 г., 13:59

🚀 Booked ₹1.37+ Lakh Profit! 💰 Another great day in the markets with smart entries & exits. 📈 Check out the power of precision trading! 🔥 🧠 Join my private trading community for real-time insights, setups, and mentorship. Whether you're new or experienced — you’ll level up fast. 👇 Click to join now 🔗https://t.me/bankniftygo 📊 Stay ahead, trade smart. 💯 #BankNifty#OptionsTrading#StockMarketIndia#TradeLab#Profits

PRICE ACTION EXPERT

@priceactionexpert · Post #7604 · 09.07.2024 г., 07:57

https://x.com/priceactiongann/status/1810583536312647828 #nifty#BankNifty my personal rules i see before taking trades, few of them have posted here! my recent research studies going on about time! make notes and study! trading is easy but work behind the scenes is the real work done, sharpen Ur skills and study always! #trading#priceaction#stockmarket#nifty50#OptionsTrading#research https://x.com/priceactiongann/status/1810583536312647828

PRICE ACTION EXPERT

@priceactionexpert · Post #7592 · 27.06.2024 г., 12:03

https://x.com/priceactiongann/status/1806296904663228873 #nifty 23910 done in nifty #timecycle helped from 24 th, price will decide here now, OLHC etc. weekly price close will be very interesting! , when #banknifty reaches 54583 u will see some magic! wait and see! #stocks#stockmarket#stockmarketindia#gann#OptionsTrading

PRICE ACTION EXPERT

@priceactionexpert · Post #7763 · 20.09.2024 г., 13:03

https://x.com/priceactiongann/status/1837115028920476072 #nifty50#banknifty 1.First of all Congrats if u have foreseen this well in advance! then congrats to other researchers and forecasters here! keep it up! 🔮👏 2.Once it breached today bank nifty and nifty it is officially in new zone of cycle which is helping bank nifty cycle to complete! 📈🚀 (its not in my edge and after it crossed it confirmed my research ) 3.Nifty Level Next Top Deciding 26010 and 26175! 📍 which coincides with bank nifty level 54583.60! 📍 We CANNOT IGNORE THE OBVIOUS UPSIDE levels! 4.THIS AREA or particular above 25300 IS NOT IN Ours ZONE AT ALL OR OUR EDGE (so we ignored upside at all costs as we focus on selective areas only which iam good at) 5.THIS EXTRA ZONE above the 25300 and 25192 is BECAUSE OF BANK NIFTY CYCLES TRYING TO COMPLETE its own cycle to 54583.60. 6.Both corelating to complete it!(which is missed to see)(will do better work and update next time considering all elements) 7.In gold i see only one cycle but in this case may be another one similar to nifty like gift nifty bank nifty , Sensex all plays crucial role and validates and helps each other markets too.(trust me ,too much of work doing all these) 🌟 Every time when long term levels coincides with nifty and bank nifty it gave us at least 500 to 800 points 8.Many mistakes were done by looking very shorter term or in a short term for Long term targets. just iam looking few 500 plus points once price is reached. sensible way to grab the vibrations. 9.Bank nifty averages 1000 to 2000 points when confluence and big levels are reached.📊 (51860 we saw 2000 points drop last time and if taken from last top to bottom it was 3600 points compared to nifty bank nifty is real good movements)📊 10.When during learning phase more winning will only boost your ego, losing will give u lots of learning. iam trying to learn at the same time lose less too. 11.All the short term cycles recent times in nifty and bank nifty as marked in charts holded for short time but taken out again easily next day,closing above and retest on top to go up more.(look charts) same cycles as nifty , bank nifty cycles 1.56268 2.54583 3.54400 4.51860 📝 12.if u still think the levels wont work 23900 or 23535(longer term levels for months years to come) my work is sometimes short term cycles but i see very much ahead in future, it is must for every trader to learn such long term skills. 🗺 13.WHICH NEVER FAILED IN PAST SO SOONER OR LATER THIS ENTIRE 23900 AND 23535 SHOULD BE REACHED FOR LONGER TERM FOR SURE. when this cycle fails either it takes on top and go up and again it will go back to where it started so given levels in long term is surely pending downside!(thats y levels are called deciding levels, so it vibrates and decides there) 🔄 14.KEEP THIS FOR VERY LONG TERM AND EVERY LEVEL IS CONFIRMATION AND DECIDING FOR SURE. All my analysis are not signals or recommendation so trade or use at ur own risk here, i post my studies and research here only!⚠️ Thanks for the support always, please do like and repost to many, More updates are upcoming. #stocks#nifty50#stock#stockmarket#OptionsTrading#trading#gann#priceaction#stockmarkets#StockMarketNews #StockMarketIndia https://x.com/priceactiongann/status/1837115028920476072