S
S
skymike2018-10-07 02:09:13
Python
skymike, 2018-10-07 02:09:13

Is it possible to compile an image directly into python script code?

There is a small script that shows a window with a confirmation button, written in PtQt5, an icon is added to the window title, everything works, but the icon is next to the script and the script is taken from the disk, I would like to somehow place the icon directly in the script code itself, I don’t know, translate it into a binary form, save it in the list and somehow get it from there, well, or something like that. Is it possible to place an image directly in the script code like this? if yes then poke your nose how to do it. Reluctance for the script to use external files. I think you can assemble the file using pyinstaller, but I would like to put the picture into the code. Thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
x67, 2018-10-07
@skymike

No need to binary, save as base64 strings directly in the code, instructions for the first and second links:
https://www.google.ru/search?newwindow=1&client=ms...

S
skymike, 2018-10-07
@skymike

Thank you, I didn’t think about base64, I googled it differently and didn’t find anything, right now I’ll dig it :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question