Ещё немного про base64.
Собрал пример со встроенной в код картинкой. Это иконка для окна на PySide2. Файл кодирован в base64 и просто сохранён в переменной.
Для использования этих данных даже не пришлось сохранять их в новый файл. Иконка создаётся на лету с помощью метода QPixmap.loadFromData()
...
raw_data = base64.decodebytes(ico_encoded)
ico = QPixmap()
ico.loadFromData(raw_data, "PNG")
...
🌎 Полный пример смотрите в gists.
#libs#tricks#qt
🌍 Some coasts shine with glowing “blue waves” at night, caused by tiny plankton called dinoflagellates emitting light when disturbed—a dazzling phenomenon known as marine bioluminescence. ✨
#seas⚡#coastline⚡#bioluminescence⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Some coastal sea cliffs are so high they have their own weather. At Kalaupapa in Hawaii, cliffs rise over 600 meters, trapping clouds and channeling winds along the shoreline. ✨
#coastline⚡#seas⚡#cliffs⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Bohai Sea in China is so shallow that its average depth is just 18 meters—less than a six-story building. This makes it one of the least deep seas in the world’s coastal regions. ✨
#seas⚡#coastlines⚡#shallow⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels