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

Резултати

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

Пребарај: #naim

当前筛选 #naim清除筛选
SIN LÍNEA MX (OFICIAL)

@SINLINEAMXnoticias · Post #31598 · 20.04.2026 г., 17:49

Para ardor de la fachiza 🔥 🔴 La torre del #NAIM en #Texcoco mantendrá su capacidad de captación de agua, mientras se consolidan canchas, gimnasios y pistas de ciclismo ⛹🏻‍♀️🏃🏻 https://revistaelpolitico.com/nacional/torre-de-control-naim-se-integrara-parque-texcoco/

MessageInABottle

@mib_messageinabottle · Post #6929 · 24.05.2024 г., 17:08

REACTIONS TO ICJ RULING ON ISRAEL'S GENOCIDE IN GAZA #Israel was ordered by the International Court of Justice (#ICJ), or world court, on Friday to halt its military assault on the city of #Rafah in #Gaza Here are some of the reactions so far, via #Reuters: #Hamas official Basem #Naim: We welcome the decision by the world court that calls on the Zionist occupation forces to end its military aggression on Rafah. We believe it is not enough since the occupation aggression across the Gaza Strip and especially in northern Gaza is just as brutal and dangerous. We call upon the UN security council to immediately implement this demand by the world court into practical measures to compel the Zionist enemy to implement the decision. We welcome the court’s request to allow investigation committees to reach the Gaza Strip to investigate acts of war of genocide against the Palestinian people and Hamas pledges to cooperate with investigation committees.” #Palestinian Authority spokesperson #AbuRudeineh: The presidency welcomes the decision issued by the International Court of Justice, which represents an international consensus on the demand to stop the all-out war on Gaza.” #Israeli finance ministerBezalel #Smotrich: Smotrich said demanding Israel stops the war against Hamas was tantamount to demanding that Israel decide to cease to exist. “Israeli will not agree to that,” he said in a statement. Israeli opposition leader Yair #Lapid: Lapid condemned Friday’s ruling by the ICJ for failing to draw a connection between its demand for an end to the fighting with a demand to return Israeli hostages held in Gaza. Normally a fierce critic of Israeli prime inister Benjamin Netanyahu, Lapid said the court’s failure to link the two issues was “a moral collapse and a moral disaster”. #EU foreign policy chief Josep #Borrell: What is going to be the [EU’s] answer to the ruling of the International Court of Justice that has been issued today, what is going to be our position? We will have to choose between our support to international institutions of the rule of law or our support to Israel.” #SouthAfrican offical Zane #Dangor: South Africa welcomes the ruling made by the court today … This order is groundbreaking as it is the first time that explicit mention is made for Israel to halt its military action in any area of Gaza. This is de facto calling for a ceasefire. It is ordering the major party in this conflict to end its belligerent action against the people of Palestine.” Former Israeli #UN envoy Danny #Danon: As ICJ judges in The Hague deliberate in comfort and return to their families, 125 hostages languish in tunnels. Israel will not cease the war until our hostages are brought back home and Hamas is completely defeated.” ++++++++++++++++