BOOKPYTHON Telegram 3511
list позволяет хранить массив из любых объектов. Это довольно удобно, но может быть неэффективно. Для компактного представления массивов базовых значений можно использовать модуль array. Поддерживаемые значения включают различные типы C, такие как char, int, long, double и другие. Фактическое представление определяется реализацией C.


import array

a = array.array('B') # Создаем массив байтов
a.append(240)
a.append(159)
a.append(144)
a.append(180)

print(a.tobytes().decode('utf8')) # Выводит: '🐴'


👉@BookPython
👍81🔥1



tgoop.com/BookPython/3511
Create:
Last Update:

list позволяет хранить массив из любых объектов. Это довольно удобно, но может быть неэффективно. Для компактного представления массивов базовых значений можно использовать модуль array. Поддерживаемые значения включают различные типы C, такие как char, int, long, double и другие. Фактическое представление определяется реализацией C.


import array

a = array.array('B') # Создаем массив байтов
a.append(240)
a.append(159)
a.append(144)
a.append(180)

print(a.tobytes().decode('utf8')) # Выводит: '🐴'


👉@BookPython

BY Библиотека Python разработчика | Книги по питону


Share with your friend now:
tgoop.com/BookPython/3511

View MORE
Open in Telegram


Telegram News

Date: |

How to Create a Private or Public Channel on Telegram? “[The defendant] could not shift his criminal liability,” Hui said. It’s yet another bloodbath on Satoshi Street. As of press time, Bitcoin (BTC) and the broader cryptocurrency market have corrected another 10 percent amid a massive sell-off. Ethereum (EHT) is down a staggering 15 percent moving close to $1,000, down more than 42 percent on the weekly chart. The initiatives announced by Perekopsky include monitoring the content in groups. According to the executive, posts identified as lacking context or as containing false information will be flagged as a potential source of disinformation. The content is then forwarded to Telegram's fact-checking channels for analysis and subsequent publication of verified information. To upload a logo, click the Menu icon and select “Manage Channel.” In a new window, hit the Camera icon.
from us


Telegram Библиотека Python разработчика | Книги по питону
FROM American