Ещё немного про base64.
Собрал пример со встроенной в код картинкой. Это иконка для окна на PySide2. Файл кодирован в base64 и просто сохранён в переменной.
Для использования этих данных даже не пришлось сохранять их в новый файл. Иконка создаётся на лету с помощью метода QPixmap.loadFromData()
...
raw_data = base64.decodebytes(ico_encoded)
ico = QPixmap()
ico.loadFromData(raw_data, "PNG")
...
🌎 Полный пример смотрите в gists.
#libs#tricks#qt
🌍 The largest tectonic plate, the Pacific Plate, moves up to 10 centimeters per year—faster than human fingernails grow. Its motion triggers earthquakes and reshapes entire coastlines. ✨
#plate⚡#tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The Himalayas are growing taller each year because the Indian plate keeps pushing into the Eurasian plate. This slow collision also makes the region one of the world’s most earthquake-prone. ✨
#plate⚡#tectonics⚡#earthquakes⚡#mountains⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Every year, thousands of tiny earthquakes ripple along Earth's mid-ocean ridges as tectonic plates slowly spread apart. These hidden quakes help shape much of the seafloor without being felt on land. ✨
#plate-tectonics ⚡#seafloor⚡#earthquakes⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Earth's crust is in constant motion due to convection currents—slow, swirling movement of hot rock deep below the surface. This drives plate movement, causing earthquakes and forming new land. ✨
#processes⚡#plate⚡#tectonics⚡#geology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍