I am wondering of how to pack several files into one single windows executable file with py2exe. I could get all python files (dll's, ...) into one py2exe. But how can i copy some of my own files (i.e. images or configuration files) into my executable and load them into python with a relative path. In Example:
file = open("config.txt",r")
file2 = open("mysubfolder\config.txt","r")
I don't know if you can embed your image files into the exe. If there is a way, I'm also interested. What I know is that you can use them from a separate folder. For this, you need to modify your setup file. Add a data path for the thing you want to load. For example, add this to your setup file:
Of course, you can add more folders or files to data_files. And for other configuration options in this setup file, you can refer to the py2exe official site.