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

Резултати

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

Пребарај: #datacenter

当前筛选 #datacenter清除筛选
producTICvidad® 📲📈

@producTICvidad · Post #847 · 16.07.2022 г., 19:55

¿Quieres conocer un #datacenter por dentro? No te pierdas este fabuloso tour virtual en 3D por uno de los centro de datos de Microsoft 👨🏽‍💻 https://news.microsoft.com/stories/microsoft-datacenter-tour/ Comparte 🔁este canal para que muchas personas también tengan acceso a esta información privilegida💚 La productividad esá en tiC 📲📈

Hashtags

The Telegram Times

@TheTGTimes · Post #439 · 29.12.2024 г., 18:58

📰DC1 is unstable We aregetting reports that telegram’s datacenter in Pluto, Miami - DC1 is experiencing some issues since a few minutes ago. The app is displaying “Updating…” at the top of the chat list, but there is no problem sending or receiving messages. This issue has only been reported for DC1. UPDATE: Issue fixed (19:04 UTC) #datacenter 👉The TG Times

Hashtags

The Telegram Times

@TheTGTimes · Post #329 · 13.04.2024 г., 20:47

📰Telegram is unstable Minutes ago, the status of all Telegram datacenter has become unstable. Its exact cause is still unknown #DataCenter 👉The TG Times

Hashtags

MikroTik.SG

@mikrotiksg · Post #329 · 18.12.2025 г., 08:04

🚀 400G Networking Made Practical Meet the MikroTik CRS804-4DDQ-hRM — a compact 400 Gigabit switch designed for AI clusters, storage fabrics, and next-generation core networks. ✅ 4× 400G QSFP-DD (breakout supported) ✅ Dual hot-swap power supplies ✅ RouterOS v7 – no subscriptions ✅ Compact & energy-efficient Enterprise speed without enterprise pricing. #MikroTik#400G#Datacenter#AI#Networking

Machinelearning

@ai_machinelearning_big_data · Post #9291 · 22.12.2025 г., 08:40

⚡️Это гигантский дата-центр Amazon за $11 млрд в Индиане. Кампус строится под обучение и инференс ИИ и будет потреблять до 2.2 ГВт - примерно как 1 миллион домов. В состав комплекса войдут собственные электростанции, поэтому нагрузка на местную энергосеть и тарифы для жителей должна быть минимальной. @ai_machinelearning_big_data #Amazon#DataCenter#AIInfrastructure#AIFactory#CloudComputing

Crypto M - Crypto News

@CryptoM · Post #64708 · 09.04.2026 г., 15:25

🚀 Amazon Plans $25 Billion Data Center Investment in Mississippi Amazon has announced plans to invest $25 billion in building a data center in Mississippi. According to Odaily, this significant investment is expected to create 2,000 jobs in the region. The initiative marks a substantial economic development for the state, promising to boost local employment and infrastructure. #Amazon#DataCenter#Mississippi#Investment#Jobs#EconomicDevelopment#Infrastructure

Venture Village Wall 🦄

@venturevillagewall · Post #3549 · 20.12.2024 г., 09:32

OptiCore Raises $5M for AI Chips OptiCore has secured $5M in funding to enhance its photonic chips, promising 100x energy efficiency and computing density for AI applications. This innovation aims to transform high-performance data center computing. #OptiCore#Funding#AI#Chips#DataCenter#Efficiency#Photonics#Computing#Revolution#Performance

Crypto M - Crypto News

@CryptoM · Post #64944 · 10.04.2026 г., 11:49

🚀 AI TRENDS | Anthropic Secures CoreWeave Data Center Capacity Amid Rising AI Demand Anthropic has agreed to lease data center capacity from CoreWeave to address the growing demand for its AI services, Jin10 reports. CoreWeave announced on Friday that the multi-year agreement will assist Anthropic in building and deploying its Claude AI model. CoreWeave's CEO, Intrator, stated that the deal will involve various Nvidia chip architectures within U.S. data centers. The financial terms of the agreement were not disclosed by either company. Anthropic, similar to OpenAI, has been at the forefront of the AI service surge, sometimes struggling to maintain its products online due to what it describes as 'unprecedented demand.' Earlier this week, Anthropic revealed a collaboration with Broadcom and Google to secure 3.5 gigawatts of energy, noting that one gigawatt of power is sufficient to supply electricity to approximately 750,000 U.S. households simultaneously. #AI#Anthropic#CoreWeave#DataCenter#ClaudeAI#Nvidia#Broadcom#Google#ArtificialIntelligence#TechTrends

Crypto M - Crypto News

@CryptoM · Post #65020 · 10.04.2026 г., 14:09

🚀 AI TRENDS | CoreWeave's Junk Bonds Rise Amid Optimism from Tech Deals CoreWeave's junk bonds experienced a rise in value due to increased market optimism following transactions with several major technology companies. According to Jin10, as of 9:05 AM New York time (21:05 UTC+8), the bonds, which have a coupon rate of 9.75% and a face value of 100 cents, increased to 101.88 cents. During the syndication process, the bond's size was expanded from the initially planned $1.25 billion. Data shows that another convertible bond issued on the same day, which was also increased to $3.5 billion, has yet to begin trading. This financing round is the latest for CoreWeave and occurred just hours after the company announced a new agreement with Meta Platforms to supply AI computing products. On Friday, Anthropic agreed to lease CoreWeave's data center capacity to meet the growing demand for its AI services. CoreWeave's stock rose more than 6% during intraday trading. #AI#CoreWeave#JunkBonds#TechDeals#Financing#Meta#Anthropic#DataCenter#StockMarket#ConvertibleBonds