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

Резултати

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

Пребарај: #valuation

当前筛选 #valuation清除筛选
Crypto M - Crypto News

@CryptoM · Post #65261 · 12.04.2026 г., 11:46

🚀 Crypto Projects Face Significant Valuation Declines According to NS3.AI, recent data from CryptoRank reveals that ten cryptocurrency projects, which once boasted billion-dollar private valuations, are now trading at market capitalizations ranging from $7 million to $294 million. These projects have experienced valuation gaps between 88% and over 99%. Notably, Scroll recorded the steepest decline at 99.54%, while Starknet saw the largest absolute drop, falling from an $8 billion valuation to approximately $199 million. #Crypto#Cryptocurrency#Valuation#MarketCrash#Blockchain#DeFi#CryptoNews#TokenEconomy

Crypto M - Crypto News

@CryptoM · Post #64477 · 09.04.2026 г., 02:04

🚀 Anthropic Completes Secondary Market Equity Sale Anthropic has recently completed a secondary market equity sale, with some employees selling a small portion of their shares to investors. According to Odaily, the limited willingness of employees to sell resulted in several investors not receiving their planned share allocations. The transaction was priced in line with the company's latest funding round valuation from February this year, maintaining Anthropic's current valuation at $350 billion, excluding the $30 billion raised in this round. #Anthropic#EquitySale#SecondaryMarket#Employees#Investors#FundingRound#Valuation#TechNews

Venture Village Wall 🦄

@venturevillagewall · Post #3899 · 17.01.2025 г., 01:00

Phantom Wallet Secures $150M Funding Phantom Wallet announces a successful $150 million funding round, achieving a $3 billion valuation. This significant investment showcases the growing interest in the DeFi sector. Read more: BBG #PhantomWallet#Funding#DeFi#Crypto#Investment#Valuation#Blockchain#Tech#Finance#Innovation#Wallet#Fintech#VentureCapital#Investors#Startups#Ecosystem#SEC#MeganBarbero

Crypto M - Crypto News

@CryptoM · Post #65216 · 12.04.2026 г., 03:33

🚀 Morpho Generates $17M Annual Revenue from Borrower Interest According to NS3.AI, Token Terminal data reveals that Morpho borrowers have paid approximately $170 million in interest over the past year. With a 10% take rate, this translates to an estimated $17 million in annualized revenue for Morpho, which holds a valuation of $1.7 billion. #Morpho#Revenue#BorrowerInterest#NS3AI#TokenTerminal#AnnualRevenue#Fintech#Blockchain#Valuation#MORPHO

Crypto M - Crypto News

@CryptoM · Post #65452 · 13.04.2026 г., 09:22

🚀 Bitcoin's Potential Valuation by 2050 Discussed by Strategist PANews posted on X (formerly Twitter) that strategist Mark Moss shared his insights on the future valuation of Bitcoin during a podcast. Moss projected that by 2050, Bitcoin could reach a value of $45 million. He further speculated that if Bitcoin were to replace the U.S. dollar as the global unit of account, its value might even soar to $500 million. Moss's predictions are based on several factors, including the anticipated growth of the global store of value basket, which he estimates will reach $80 trillion by 2050. He believes Bitcoin could potentially capture around 20% of this market share. Additionally, Moss highlighted the impact of a 50-year cycle of technological revolution and the geopolitical trend towards de-dollarization, suggesting that these elements could contribute to Bitcoin's significant valuation increase. #Bitcoin#Valuation #2050 #MarkMoss#FuturePrediction#Cryptocurrency#GlobalEconomy#StoreOfValue#DeDollarization#Geopolitics#TechnologicalRevolution#DigitalCurrency#BTC

Venture Village Wall 🦄

@venturevillagewall · Post #4126 · 11.02.2025 г., 22:00

BitGo Considers IPO in 2025 Crypto custodian BitGo Inc. is exploring an IPO, potentially listing in H2 2025 amid positive regulatory climate. The company raised $100 million in 2023, increasing its valuation to $1.75 billion. This move aligns with growing institutional interest in crypto. Read more: Bloomberg #Crypto#IPO#BitGo#Blockchain#Investment#MSTR#Profit#Custody#Regulation#Market#Financial#Valuation#Institutional#Assets#Saylor#Trading#News#Tech#Finance#VC

Venture Village Wall 🦄

@venturevillagewall · Post #3850 · 11.01.2025 г., 19:00

$1M Raised for E3 Enclave Project Open-source protocol E3 Enclave successfully raised $1M during its public sale, achieving a $60M fully diluted valuation. The sale was conducted on the Legion platform. Meanwhile, AI-focused protocol BAD Coin secured $1.25M at a $12.5M valuation, emphasizing growth in the AI and crypto sectors. Read more: E3 Enclave | BAD Coin #E3Enclave#BADCoin#AI#Crypto#PublicSale#Blockchain#Funding#Legion#Investment#TechNews#Finance#DeFi#Innovation#Startups#VentureCapital#CryptoNews#TokenSale#Valuation #2025 #Oklahoma#Fraud

Venture Village Wall 🦄

@venturevillagewall · Post #4102 · 08.02.2025 г., 22:00

SSI Negotiates $20 Billion Funding Round Ilya Sutskever's company, SSI, rapidly grew to a $5 billion valuation within three months of its launch last summer. Current reports suggest negotiations for a funding round that could value it at $20 billion. Remarkably, SSI has no plans to release any products soon, opting to skip intermediary steps to achieve 'safe superintelligence'. Details about what Ilya is showcasing to potential investors remain unclear. Read more: Reuters Article #SSI#IlyaSutskever#Funding#Investment#Superintelligence#TechGrowth#AI#Valuation#Investors#Innovation#ProductDevelopment#IndustryNews#Technology#VentureCapital#Startups#BusinessNews#MarketTrends#Crypto#VC

Crypto M - Crypto News

@CryptoM · Post #64918 · 10.04.2026 г., 09:28

🚀 Goldman Sachs Highlights Undervaluation in Global IT Sector Goldman Sachs has identified the global IT sector as undervalued following a significant decline in its valuation premium. According to NS3.AI, analysts at Goldman Sachs noted that the sector is currently trading at a lower price-to-earnings ratio compared to consumer discretionary, consumer staples, and industrials. They also pointed out that earnings revisions in the tech sector are more robust than in other sectors. However, they cautioned that tighter credit conditions or reduced revenue from hyperscalers could impact the sector's spending returns. #GoldmanSachs#ITsector#undervaluation#valuation#techsector#earningsrevisions#creditconditions#hyperscalers#consumerdiscretionary#consumerstaples#industrials

Venture Village Wall 🦄

@venturevillagewall · Post #4317 · 06.03.2025 г., 01:00

Notable Updates on Crypto Events and Funding White House source confirms Cardano's Charles Hoskinson excluded from the March 8 Crypto Summit. Cardano hasn't engaged with the administration in policy talks. Additionally, DoubleZero Foundation raises $28M at $400M valuation, plans expansion. CANARY files S-1 for AXL ETF, focusing on blockchain interoperability. #Cardano#Crypto#Hoskinson#DoubleZero#Blockchain#Funding#AXLETF#Web3#Investing#Valuation#Solana#XRP#Hedera#Stellar#TON#Sui#Bitcoin#VC#Testnet