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

Резултати

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

Пребарај: #streaming

当前筛选 #streaming清除筛选

🤍💫 | #BTS News 🗞️ — FESTA CUP IS COMING!! 🏆 Let’s work together to support SWIM & ARIRANG’s longevity and increased streaming from May 12th - Jun 13th. Tomorrow begins with the “Please SWIM One More Night” Streaming Battle and Streaming Parties. Check Link for more info👇🏻 🔻 : (https://festa2026.carrd.co/) #streaming @foreverbulletproof7

Direction的碎碎念

@directionchannel · Post #5692 · 11.08.2022 г., 04:54

#News#Streaming 📺迪士尼流媒体总订户数超过Netflix 迪士尼旗下流媒体(Disney+, ESPN+, Hulu)总订户数达到2.21亿,超过Netflix2.207亿,成为全球最大的流媒体公司 其中Disney+ 1.377亿,Hulu 4560万,ESPN+ 2230万 Channel:@Odyssey+

纯情男高

@hanzichen · Post #1453 · 18.12.2025 г., 05:02

PlayTorrio PlayTorrio is an all-in-one media center application that brings together streaming, torrenting, and media management in a beautiful, easy-to-use interface. 🔗 Links: - Download - Screenshots - Features - Website - Source code Developer: ayman707-ux 🫂 Special thanks to: • ᴅᴜxᴛᴀᴍɪ for post • Chopra Ji | [#Inactive] for banner • alex†s | chime/rtwo for screenshots ❤️ Support the Project If this project makes your life easier, here are a few quick ways to show some love: ⭐ Star the repo/app ☕ Buy a coffee for the developer 🛠 Contribute code, issues, or pull-requests 🏷 Tags: #Streaming#Linux#Windows#MacOS

BotsGram®

@botsgram_cu · Post #3652 · 14.03.2021 г., 17:03

¿Que puede hacer este bot? @FileStreamingBot Este bot le brinda un enlace para transmitir cualquier archivo, película o video en Telegram a través de servidores de alta velocidad. También puede descargar el archivo usando un administrador de descargas IDM o ADM. Idioma: inglés (Visto en @botsgram_cu) #enlaces#videos#streaming#descargas

BotsGram®

@botsgram_cu · Post #4022 · 15.06.2021 г., 23:08

¿Que puede hacer este bot? @StreamRadarBot Este bot le muestra en qué plataformas de transmisión están disponibles las películas o series de su elección. Idiomas: español, inglés (Visto en @botsgram_cu) #películas#series#streaming

Libreware

@libreware · Post #1197 · 31.10.2023 г., 13:57

. Louis Rossman and FUTO have released another not -FOSS app of interest. This time they bring us the #video#streaming app #Grayjay, which is designed to let you surf and search all you favorite video streaming services at once. Grayjay does everything the popular NewPipe app does, plus more. Unfortunately NewPipe only worked with YouTube and PeerTube. So far Grayjay works w/these platforms (to a certain extent) - Rumble - Odysee - Youtube - FUTO's PeerTube Instance - Twitch - Patreon - Soundcloud - Kick - Nebula Sorry, no BitChute so far. You can download videos for offline viewing, and then export those to your Movies folder on your phone. You can download the apk install file here: https://grayjay.app/ Their GitLab source code can be found here: https://gitlab.futo.org/videostreaming/grayjay Casting: https://gitlab.futo.org/videostreaming/grayjay/-/blob/master/docs/casting.md ⚠️ License https://gitlab.futo.org/alex/voiceinput/-/blob/master/FTL_LICENSE.md ⚡️@LinuxTechIndex

BotsGram®

@botsgram_cu · Post #3054 · 11.10.2020 г., 04:52

¿Que puede hacer este bot? @anime_streaming_bot ¡Este bot ofrece una enorme biblioteca de anime que puedes ver en streaming sin ningún tipo de publicidad, subtitulados y doblados en ingles, espanol e italiano también es HD! Idiomas: Inglés Italiano Español (Visto en @botsgram_cu) #anime#descarga#streaming#manga

Libreware

@libreware · Post #1198 · 02.11.2023 г., 04:37

BraveNewPipe A libre lightweight streaming front-end for Android Due to restrictive project policy, the #NewPipe team refuses to add platforms that they find offensive. This fork (BraveNewPipe) will not be as restrictive. As long as the platforms work in the spirit of free speech, they could be integrated. Nevertheless, platforms that promote pornography or other degrading things will NOT be included here. Contribute This fork will focus only on integrating other platforms. Unrelated patches will be rejected for now. Feel free to suggest which alternative platforms should be included. Any contribution (development/testing/bug report) is greatly appreciated. Which additional platforms are supported? Bitchute Rumble Other features not found in NewPipe -NewPipe x Sponsorblock into this fork -searchfilters: in the action menu of the search page you can now change the search behavior for the actual search. The supported content/sort filters depend on the service https://github.com/bravenewpipe/NewPipe Download https://github.com/bravenewpipe/NewPipe/releases #yt#video#streaming

Russisches Haus in Berlin

@rushaus · Post #2025 · 01.12.2025 г., 08:05

Manche Geschichten verlieren nie ihre Magie — „Die Schneekönigin“ 1966 gehört genau dazu.❄️👑 📽️ Dieser zauberhafte Märchenfilm basiert auf Hans Christian Andersens klassischer Erzählung und ist perfekt für alle, die magische Geschichten lieben und sich von mutigen Helden inspirieren lassen möchten. 📺 Den Film kann man am Sonntag, dem 7. Dezember, um 13:55 Uhr bei RBB und am Samstag, dem 20. Dezember, um 16:00 bei MDR, oder schon jederzeit in ARD-Mediathek. Ideal für einen gemütlichen nostalgischen Winterabend mit der Familie!🍿🥰 #schneekönigin#filmabend#kino#ardmediathek#rbb#streaming#märchen

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