Packaging Images in py2exe? Packaging Images in py2exe? tkinter tkinter

Packaging Images in py2exe?


It seems the problem is that the TSicon.ico is not copied to the same folder where the .exe file resides. Assume that the python file and TSicon.ico are in the same folder. Then, you setup.py should look like this:

from distutils.core import setupimport py2exedata_files = [('', [r'TSicon.ico'])]setup(windows =['tk_with_image.py'],data_files = data_files,options={         })

Now the .exe file and the TSicon.ico will be in the same folder (dist), and everything should work.