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

Резултати

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

Пребарај: #simret

当前筛选 #simret清除筛选
Borkena

@borkena · Post #5509 · 10.12.2025 г., 05:31

Democratic Simret Tigray Gets Official Recognition From Electoral Board. Read more. https://borkena.com/2025/12/10/ethiopia-democratic-simret-tigray-gets-official-recognition-from-electoral-board/#Ethiopia#news#Simret

Addis Standard

@addisstandardeng · Post #21503 · 23.02.2026 г., 14:11

News update: #Tigray Democratic Solidarity rejects HoF decision, threatens to boycott elections and similar ‘illegal acts’ if unresolved Tigray Democratic Solidarity (#Simret) has called on the House of #Federation (HoF) to reconsider its decision to remove electoral constituencies in districts previously under the Tigray region administration, describing the move as “unconstitutional” and warning that it undermines Ethiopia’s federal system. In a letter addressed to both the House of Federation and the National Election Board of Ethiopia (#NEBE), Simret said the decision constitutes an act that “undermines the country’s constitutional order, crushes institutional independence, and effectively declares ‘constitutional anarchy’.” Citing Article 62 of the FDRE Constitution, the party argued that the House of Federation’s powers are limited to constitutional interpretation & the resolution of regional boundary disputes. Simret further argued that boundary... Read more: https://addisstandard.com/?p=55350

Addis Standard

@addisstandardeng · Post #21681 · 11.03.2026 г., 15:03

News: Simret withdraws lawsuit challenging #NEBE decision on five #Tigray constituencies; Getachew Reda says dispute requires political resolution The Tigray Democratic Solidarity (#Simret) party has withdrawn its lawsuit challenging a decision by the National Election Board of #Ethiopia (NEBE) concerning five electoral constituencies in Tigray, party leader #Getachew_Reda confirmed to Addis Standard today. Getachew, who is also Advisor to the Ethiopian Pm, said the party submitted a formal request to the Federal High Court seeking to discontinue the case, arguing that documents presented during earlier proceedings showed that what had been described as a decision of the House of Federation did not constitute a formal institutional ruling made through constitutional procedures. According to him, the document produced in court indicated that the matter reflected the position of officials rather than a decision adopted through the House’s legally required…… Read more: https://addisstandard.com/?p=55753