Ещё немного про base64.
Собрал пример со встроенной в код картинкой. Это иконка для окна на PySide2. Файл кодирован в base64 и просто сохранён в переменной.
Для использования этих данных даже не пришлось сохранять их в новый файл. Иконка создаётся на лету с помощью метода QPixmap.loadFromData()
...
raw_data = base64.decodebytes(ico_encoded)
ico = QPixmap()
ico.loadFromData(raw_data, "PNG")
...
🌎 Полный пример смотрите в gists.
#libs#tricks#qt
🪐 In 2023, astronomers observed a rare type of supernova explosion in the galaxy NGC 4995, located about 59 million light-years away. Classified as a Type Iax supernova, this unusual blast is thought to be a "partial" explosion where the white dwarf star survives the event—unlike normal supernovae, which completely destroy their stars—offering new insight into the variety of stellar deaths in the cosmos. ✨
#supernovae⚡#ngc4995⚡#stardeath⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 One of the most powerful supernova explosions ever recorded was SN 1006, observed in 1006 AD and visible from Earth for months—even during the daytime. Located about 7,200 light-years away in the constellation Lupus, this supernova was likely caused by a white dwarf star (the dense remnant of a Sun-like star) pulling in material from a companion until it exploded, briefly becoming brighter than Venus and leaving behind a vast, glowing remnant still detected today. ✨
#supernova⚡#Lupus⚡#stardeath⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels