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

Резултати

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

Пребарај: #seedfunding

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

@CryptoM · Post #65173 · 11.04.2026 г., 16:05

🚀 USDi Stablecoin Seeks $1.5 Million in Seed Funding Amid Rising Inflation USDi, a stablecoin already in circulation, is aiming to secure approximately $1.5 million in seed funding. According to NS3.AI, the token is designed to track the U.S. Consumer Price Index (CPI) and is intended to increase in value with inflation, rather than maintaining a fixed nominal value of $1. Michael Ashton highlighted that the initiative comes at a time when U.S. inflation has surged to 0.9% in the past month, primarily due to energy costs linked to the ongoing conflict in Iran. #USDi#Stablecoin#SeedFunding#Inflation#CPI#EnergyCosts#IranConflict

Venture Village Wall 🦄

@venturevillagewall · Post #4108 · 09.02.2025 г., 19:00

End Chokepoint 2.0 Now! Senator Lummis urges that personal beliefs regarding guns, #Bitcoin, crypto, and religion should not affect banking practices, calling for an end to Chokepoint 2.0. In other news, Coala Pay secures $3.50M in Seed funding led by Castle Island Ventures, alongside participation from Lattice Fund and Factor Capital. Read more here: ICO Analytics #Bitcoin#Crypto#VC#Banking#Funding#Chokepoint2.0 #Politics#SenatorLummis#InternationalAid#CoalaPay#Investing#SeedFunding

Crypto M - Crypto News

@CryptoM · Post #64994 · 10.04.2026 г., 13:15

🚀 SimpleChain Secures $15 Million in Seed Funding for RWA Network SimpleChain has announced the successful completion of a $15 million seed funding round. According to Foresight News, the funding was supported by family offices and institutional investors. SimpleChain aims to develop a Real World Asset (RWA) Layer 1 network, positioning itself as an 'Institutional OS' for RWA. The network will be powered by Granular Data and native CaaS, focusing on providing financial-grade infrastructure for the tokenization of real-world assets globally. #SimpleChain#SeedFunding#RWA#Layer1Network#InstitutionalOS#GranularData#CaaS#Tokenization#RealWorldAssets#FinancialInfrastructure

Venture Village Wall 🦄

@venturevillagewall · Post #4142 · 13.02.2025 г., 16:00

Teneo Raises $3M for Decentralized Platform Teneo, a decentralized data utilization and tokenization platform (formerly ELOOP), has secured $3M in Seed funding led by RockawayX and Borderless Capital. Ethereum L1 users spent $570M in January 2025, showcasing active economic engagement. Additionally, Plasma raised $24M to launch a blockchain for Tether, enabling zero-fee USDT transactions. Read more: Tokenterminal | Fortune #Teneo#Blockchain#Funding#Plasma#Ethereum#DeFi#Crypto#Tokenization#SeedFunding#NEIRO#USDT#EVM#Web3#Bitcoin#Solana#Investments#VC#EconomicActivity#DigitalAssets#Stablecoin

Venture Village Wall 🦄

@venturevillagewall · Post #3431 · 18.12.2024 г., 14:33

Silencio Raises $2.5M in Seed Funding Community-focused network Silencio, tackling noise pollution, secures $2.5M in Seed funding led by Blockchange Ventures, with contributions from Borderless Capital, Master Ventures, Blockchain Founders Fund (BFF), Prosper GmbH & Co. KG, and Advanced Blockchain AG. #Silencio#Fundraising#NoisePollution#SeedFunding#BlockchangeVentures#BorderlessCapital#MasterVentures#BlockchainFoundersFund#ProsperGmbH#AdvancedBlockchainAG

Venture Village Wall 🦄

@venturevillagewall · Post #4255 · 26.02.2025 г., 22:00

Major Crypto Hacks and Market Updates Bybit suffers $1.4B ETH hack, among largest ever, surpassing Mt. Gox and FTX. NVIDIA posts strong Q4 FY25 results; expects $43B Q1 FY26 revenue. Bitcoin drops to $82,236, with over $433M liquidated. Bank of America set to launch its own dollar stablecoin, joining other major banks in the crypto finance space. Donald Trump's tariffs may impact Bitcoin prices. #Crypto#Bitcoin#ETH#NVIDIA#Hack#Stablecoin#MarketManipulation#Finance#BankOfAmerica#Tariffs#Liquidity#Tech#USDC#USDT#Aegis#Truesense#Ligero#SeedFunding#VC#AI

Venture Village Wall 🦄

@venturevillagewall · Post #4032 · 30.01.2025 г., 19:00

Cedar Money Raises $9.90M in Seed Funding 📈 Cedar Money, a stablecoin-powered payments platform, has secured $9.90M in a Seed funding round led by QED Investors. The funding aims to enhance cross-border payment solutions using digital assets. 💰 Other funding highlights include: - McQueen Labs Inc. raised $1.16M for luxury car investments. - Irreducible raised $24M for ZKP acceleration. - Mevvy secured $2.80M for MEV execution. - Clipper acquired by Sushi Labs. 🇨🇿 In a groundbreaking move, the Czech National Bank is considering investing up to 5% of its €146 billion reserves in bitcoin, making it the first Western central bank to officially do so if approved. 🔗 Read more about Cedar Money at ICO Analytics. #CedarMoney#SeedFunding#Stablecoin#Crypto#Bitcoin#CzechRepublic#Investment#Fintech#Payments#DigitalAssets#McQueenLabs#Irreducible#Mevvy#SushiLabs#VC#Innovation#Economy#Blockchain#Regulation#FundingRound