Hi All'
How can I embed images (.png, .gif, etc) into a single py file and call them in program
I saw them in wxpy demo but how exactly to embedd them??
Appreciation,
Steve
Hi All'
How can I embed images (.png, .gif, etc) into a single py file and call them in program
I saw them in wxpy demo but how exactly to embedd them??
Appreciation,
Steve
I meant storing images in .py file. I don't know if it is synonomous with embedding!
Have a look at vega's code snippet on this:
http://www.daniweb.com/code/snippet393.html
I think it is what you want. Otherwise just explain exactly what you mean by storing it in a .py file.
how do you conert them to that form?
I mean from something.png to "zyYsabskalUYDTbsnsmjahaHSGYDKD" representing that image
I find it puzzling
This was how vega did it:
import base64
jpgfile = "halloween3.jpg"
jpg_text = base64.encodestring(open(jpgfile,"rb").read())
print jpg_text
Hope that helps.
Thanks I will give a try!
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.