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

Резултати

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

Пребарај: #wealth

当前筛选 #wealth清除筛选
Go! Announcements

@gorwachain_announcements · Post #506 · 25.08.2024 г., 21:30

There's a lot to be made by tapping and claiming coins from the Go! Ton App! Get started Here: https://t.me/thegoprojectBot This bot is your free pass to Sweet rewards, get started Now. Once you get started, you've got to maintain your spot as a weekly and monthly active user. Here's why: 🔹 There are more rewards as you get more active 🔹 You get features nobody else gets 🔹 You get into higher ranks which means exclusive airdrops will be sent to you. 🔹 You get access to collectibles reserved just for you 🔹 You get to Contribute more to the community, and influence the direction of the project Ready to start Tapping? Let's Go: https://t.me/thegoprojectBot #gotonapp#tap2earn#bot#rewards#boost#wealth Join: 🐣X✉️Chat✉️News🤖Discord Play: 🕹️TON App💻Web App Info: 🖥Newsletter🌐Website🌐Blog

Inspiring Images

@InspiringImages · Post #13506 · 22.01.2026 г., 05:13

Rich Dad vs Poor Dad mindset 💸 Poor Dad: “Money comes when you work.” Rich Dad: “Money comes when you build a system.” The lesson: Don’t only trade time for money. Build assets, skills, and processes that pay you repeatedly. Today’s action: Pick ONE system to start: • automate savings/investing • create a digital product • build a side business workflow #RichDadPoorDad#money#wealth#mindset#financialfreedom#selfimprovement#books

Crypto Fight || News 🚀

@cryptofightnews · Post #2910 · 18.09.2025 г., 07:52

🚀 Analyst Price Targets: $2–$5 Long Term 🚀 Royals see it. Whales see it. Do you? Buy at $0.00405 before it’s too late. 👉www.shheikh.io #Crypto#Blockchain#AI#RWA#DeFi#Tokenization#Altcoins#CryptoCommunity#Presale#BullRun2025#NextBigThing#Wealth

Airdrop Comic

@airdropcomic · Post #2147 · 16.10.2025 г., 12:24

🔥Presale – SHHEIKH Phase 2 (LIVE) ✅ 💠Total Reward: Token Raises $6.92M+ in Phase 2, Attracts Global Investors 🚨SHHEIKH Presale Surpasses $6.92M+ — Momentum Is Unstoppable 🚨 ✅ $6.92M+ raised ✅ 2.21B+ tokens sold ☀️Presale Link: – Click Here ♦️AI + RWA = the next trillion-dollar blockchain market. ♦️Secure SHHEIKH at $0.00405 before the next surge. ♦️Follow their Twitter account ♦️Join their Telegram Channel 📅End Date: TBA 📤Distribution: After campaign ends ®Note - Please do your own research (DYOR) before joining to any airdrops project. #Crypto#Blockchain#AI#RWA#DeFi#Tokenization#Altcoins#Presale#CryptoCommunity#Wealth#FutureOfFinance#BullRun2025

Crypto Officer™

@cryptoofficer · Post #1568 · 09.10.2025 г., 02:39

📦New Project Spotlight: SHHEIKH Token 🔥 🪙 Phase 2 Live: $0.00405 + 5% Bonus 💎Rating: ⭐️⭐️⭐️⭐️⭐️ 🔗Participate now: www.shheikh.io =========================== 📣How to participate: ✅Visit www.shheikh.io ✅ Connect your wallet ✅ Purchase SHHEIKH tokens (Min: $10) ✅ Receive instant 5% bonus ✅ Follow their Twitter & Join Telegram =========================== 🖥SHHEIKH has raised $6.53M+ USDT and sold 2.05 BILLION tokens in Phase 2. Recognized as the #1 AI + RWA project of 2025, combining artificial intelligence with real-world asset tokenization. 🚨Why investors are watching: ✅Royals & whales accumulating positions ✅ $6.53M+ raised from global investors ✅ Analysts' top AI + RWA pick for 2025 ✅ Still early entry before phase closes #Crypto#Blockchain#AI#RWA#DeFi#Altcoins#Tokenization#BullRun2025#NextBigThing#Presale#Wealth#CryptoCommunity 🔴Note:Please do your own research (DYOR) before participating. This is not financial advice (NFA).

Venture Village Wall 🦄

@venturevillagewall · Post #3672 · 21.12.2024 г., 18:50

Sheldon Schiff Proposes USAcoin Peter Schiff advocates replacing Bitcoin as a strategic US reserve with a new crypto asset, USAcoin, featuring a limited supply of 21 million coins and an improved blockchain for better payment capability. He highlights this shift as a pathway to wealth, contrasting his views on Bitcoin, which he refers to as digital gold. Schiff also generated an image with Elon Musk and Donald Trump against a Bitcoin backdrop, criticizing ChatGPT for its content restrictions. _"HODL to the Moon, America!"_ #PeterSchiff#USAcoin#Crypto#Bitcoin#Blockchain#Investment#DigitalGold#Wealth#PaymentSystems#Grok

Venture Village Wall 🦄

@venturevillagewall · Post #4004 · 28.01.2025 г., 01:00

Bitcoin Surges to $102,000 Bitcoin's price has skyrocketed to $102,000, marking a significant milestone in its market value. This surge indicates rising investor confidence and increasing demand in the cryptocurrency sector. #Bitcoin#Crypto#Market#Finance#Investing#BullMarket#Blockchain#Volatility#Trends#Wealth#Trading#Technology#Asset#DigitalCurrency#PriceRise

Airdrop Ninja™

@airdropsalertteam · Post #9466 · 09.10.2025 г., 02:41

📦Exclusive Project Spotlight: SHHEIKH Token 👑 🛍 Phase 2 Price: $0.00405 | Minimum: $10 USDT 💎 Status: Gaining Major Royal Attention 🔗Official Site: www.shheikh.io =========================== 📣How to Participate: ✅Visit www.shheikh.io ✅ Connect Your Wallet ✅ Purchase SHHEIKH Tokens ✅ Follow Twitter & Join Telegram =========================== 🔥SHHEIKH has raised $6.53M+ USDT with confirmed interest from Middle Eastern royal investors. This AI-powered RWA project represents real institutional momentum and technological innovation. 🚨Key Highlights: ✅$6.53M+ raised from global investors ✅Middle Eastern royals in active talks ✅ Real institutional power and backing ✅ Limited time remaining in Phase 2 #Crypto#Blockchain#AI#RWA#DeFi#Altcoins#Tokenization#Presale#CryptoCommunity#BullRun2025#Wealth#NextBigThing 🔴Note:Please do your own research (DYOR) before participating. Nothing in this post is financial advice (NFA).

Venture Village Wall 🦄

@venturevillagewall · Post #4023 · 29.01.2025 г., 19:00

Massive $4M Profit in Hours! Mr. Burns profited over $4 million within six hours of trading the VINE token. Initially investing $70k, he sold 9.96 million VINE for $2.36 million while retaining 4.67 million VINE worth $1.73 million—highlighting a surge in the token's value. 📈 Full story: Mr. Burns’ Trading Success #Crypto#VINE#Trading#Profit#Investing#Tokens#Blockchain#ATH#Finance#Wealth#MrBurns#VentureCapital#Speculation

Venture Village Wall 🦄

@venturevillagewall · Post #4077 · 05.02.2025 г., 19:00

BlackRock Launches Bitcoin ETP in Europe BlackRock, the largest asset manager globally, is set to launch an exchange-traded product (ETP) linked to Bitcoin in Europe. Marketing may start this month, marking BlackRock's first crypto-linked ETP outside North America. Read more #BlackRock#Bitcoin#ETP#Crypto#Finance#Investment#Europe#Assets#Market#Trade#Blockchain#News#Regulation#ETF#DigitalAssets#Wealth#Trading#Economy#Global#FinanceNews

Venture Village Wall 🦄

@venturevillagewall · Post #3380 · 18.12.2024 г., 12:09

Mirabelle Secures $1.05M Funding Mirabelle, specializing in mortgage life financing for seniors, has secured $1.05 million in funding as of December 3, 2024. The service aims to enhance retirement experiences by valuing wealth while allowing seniors to remain in their homes. #Funding#Mortgage#LifeFinance#Seniors#Retirement#Housing#Wealth#FinancialServices#Mirabelle#Finance

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