TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #242 · 7 мај

Теперь запакуем строку. В этом случае следует передавать тип данных bytes. >>> struct.pack('=s', b'a') b'a' Для записи слова следует указывать количество символов. >>> struct.pack('=5s', b'hello') b'hello' Кстати, запакованный вид соответствует исходному тексту. Всё верно, символ есть в таблице ASCII, то есть его код попадает в диапазон 0-127, он может быть записан одним байтом и имеет визуальное представление. А вот что будет если добавить символ вне ASCII >>> struct.pack(f'=s', b'ё') SyntaxError: bytes can only contain ASCII literal characters. Ошибка возникла еще на этапе создания объекта bytes, который не может содержать такой символ. Поэтому надо кодировать эти байты из строки. >>> enc = 'ёжик'.encode('utf-8') >>> struct.pack(f'={len(enc)}s', enc) b'\xd1\x91\xd0\xb6\xd0\xb8\xd0\xba' Заметьте, длина такой строки в байтах отличается от исходной длины, так как символы вне ASCII записываются двумя байтами и более. Поэтому здесь формат создаём на лету, используя получившуюся длину как каунтер токена. #libs#basic

Hashtags

Резултати

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

Пребарај: #textpost

当前筛选 #textpost清除筛选
цикорiй

@tsukassadrive · Post #1626 · 20.05.2024 г., 07:42

#random#textpost#meme#original I heard you is a doomer, nigga. The world cherishes you, nigga. The world is still when you out of hustle and bustle of the human discourse, nigga. This stillness is boundless, nigga. This stillness makes life worth living, nigga. The world is indeed filled with despair and pain, nigga, but as to counter it, the world is filled with the wonder you can't even imagine, nigga. But don't go filtering out your ordinary life for them life's highs and lows, nigga. Just as you read this text, in this most ordinary moment, you don't experience any of your life's problems, nigga. You have time to read this pasta on the internet, nigga, so don't give in to your thought-autopilot and regain control of your life that is right now, nigga, not in the not-yet existing future or the past that only was, nigga.

Desi Memes Funny Jokes

@DESI_MEMES_Funny_Jokes · Post #5894 · 29.11.2024 г., 09:04

Dost ko v Lana chahiye tha 🌚 . . . . Tags-#quotesdaily#quote#quotestagram#quotesaboutlife#quoteoftheday#quotes#aesthetic#fypage#fypシ#explore#explorepage#relatabletextpost#relatablequotes#relatable#textpost#thoughtoftheday#thoughts#funnyquotes#funny#trending#bollywoodsongs#bollywood#feed#relatableshit#lovemoments💕#meandher#meandhim❤️#mostloved#manifesting

Desi Memes Funny Jokes

@DESI_MEMES_Funny_Jokes · Post #5888 · 28.11.2024 г., 16:45

Chaliye swarg se ghum kr aate h 😂🤡 . . . . Tags-#quotesdaily#quote#quotestagram#quotesaboutlife#quoteoftheday#quotes#aesthetic#fypage#fypシ#explore#explorepage#relatabletextpost#relatablequotes#relatable#textpost#thoughtoftheday#thoughts#funnyquotes#funny#trending#bollywoodsongs#bollywood#feed#relatableshit#lovemoments💕#meandher#meandhim❤️#mostloved#manifesting

Desi Memes Funny Jokes

@DESI_MEMES_Funny_Jokes · Post #5543 · 24.10.2024 г., 13:23

Bolo n chup kahe ho 😆✊🏻 . . . . Tags-#quotesdaily#quote#quotestagram#quotesaboutlife#quoteoftheday#quotes#aesthetic#fypage#fypシ#explore#explorepage#relatabletextpost#relatablequotes#relatable#textpost#thoughtoftheday#thoughts#funnyquotes#funny#trending#bollywoodsongs#bollywood#feed#relatableshit#lovemoments💕#meandher#meandhim❤️#mostloved#manifesting