"""
This is a way to save the startup time when running img2py on lots of
files…
"""
##import wxversion
##wxversion.select('2.5')
import sys
from wx.tools import img2py
from wx import EmptyIcon
headerStuff = '''#Boa:PyImgResource:-----------------------------------
# This file was generated by encode_mybitmaps.py
#
from wx.lib.embeddedimage import PyEmbeddedImage
import cStringIO
'''
can't creat ImageResources from a image
What did you try? Anyhow this sounds more like a wxPython question.
This is how I do it:
#!/usr/bin/env python
#-----------------------------------------------
"""
This is a way to save the startup time when running img2py on lots of
files…
"""
##import wxversion
##wxversion.select('2.5')
import sys
from wx.tools import img2py
from wx import EmptyIcon
headerStuff = '''#Boa:PyImgResource:-----------------------------------
# This file was generated by encode_mybitmaps.py
#
from wx.lib.embeddedimage import PyEmbeddedImage
import cStringIO
'''
imageFile = file("../myimages.py", "w+")
imageFile.write(headerStuff)
imageFile.close()
command_lines = [
"-a -u -f -i -n image1 image1.png ../myimages.py",
"-a -u -f -i -n image2 image2.png ../myimages.py",
]
if __name__ == "__main__":
for line in command_lines:
args = line.split()
img2py.main(args)
And I use them like this:
img = myimages.getbottleCopyImage()
Hope this helps
Werner
thanks you ,Werner!