@sgmrt · Post #2279 · 05.03.2025 г., 09:04
[CCL]: Train services have resumed to normalcy. Free regular bus services will cease between #Promenade and #Serangoon. We are sorry for affecting your commute. - SMRT
Hashtags
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
Пребарај: #serangoon
@sgmrt · Post #2279 · 05.03.2025 г., 09:04
[CCL]: Train services have resumed to normalcy. Free regular bus services will cease between #Promenade and #Serangoon. We are sorry for affecting your commute. - SMRT
Hashtags
@sgmrt · Post #2274 · 05.03.2025 г., 08:14
[CCL]: Please add 30 mins train travel time between #Promenade and #Serangoon, in both directions due to train fault. Free regular bus service is available between #Promenade and #Serangoon. Train service is still available. - SMRT
Hashtags
@sgmrt · Post #2181 · 14.12.2024 г., 11:14
[CCL] UPDATE: Train fault cleared. Train service between #Promenade and #Serangoon is progressively returning to normal. Free regular bus service are still available between #Promenade and #Serangoon. - SMRT
Hashtags
@sgmrt · Post #2180 · 14.12.2024 г., 11:05
[CCL] UPDATE: Please add an additional 30mins train travel time between #Promenade and #Serangoon due to a train fault. Free regular bus service are available between #Promenade and #Serangoon. - SMRT
Hashtags
@sgmrt · Post #2179 · 14.12.2024 г., 10:49
[CCL] UPDATE: Additional 30mins train travel time between #Promenade and #Serangoon due to a train fault. Free regular bus service are available between #Promenade and #Serangoon. - SMRT
Hashtags
@sgmrt · Post #1424 · 01.04.2022 г., 04:26
[CCL] CLEARED: Fault cleared, trains service progressively resuming. Free regular bus and bridging bus services between #Promenade and #Serangoon are still available. - SMRT
Hashtags
@sgmrt · Post #2352 · 20.05.2025 г., 00:44
[CCL] UPDATE: Train fault has recovered, train services are progressively resuming. Free regular bus services are still available between #Serangoon and #BuonaVista. - SMRT
Hashtags
@sgmrt · Post #2351 · 20.05.2025 г., 00:39
[CCL] UPDATE: Please continue to add 30min travel time between #PayaLebar and #BuonaVista. Free regular bus services are available between #Serangoon and #BuonaVista - SMRT
Hashtags
@sgmrt · Post #2350 · 20.05.2025 г., 00:34
[CCL]: Due to a train fault, please add 30 minutes travel time between #PayaLebar and #BuonaVista. Free regular bus services are available between #Serangoon and #BuonaVista. https://bit.ly/44HtD1b - SMRT
Hashtags
@sgmrt · Post #1422 · 01.04.2022 г., 04:09
[CCL] UPDATE: Additional 30mins train travel time between #Stadium and #Bartley due to a train fault. Free regular bus and bridging bus services between #Promenade and #Serangoon are available. - SMRT
@sgmrt · Post #1420 · 01.04.2022 г., 03:52
[CCL] Additional 20mins train travel time between #Stadium and #Bartley due to a train fault. Free regular bus services between #Promenade and #Serangoon are available. - SMRT
@sgmrt · Post #2278 · 05.03.2025 г., 08:54
[CCL]: Train services are progressively returning to normalcy. Please add 5 mins of additional travelling time between #Promenade and #Serangoon in both directions. Free regular bus services are available between #Promenade and #Serangoon. Shuttle train service will cease between #Bartley and #Mountbatten. - SMRT