I have a python script which reads a large dictionary file which is stored as a .txt file. Now I want to make a single executable using py2exe. Currently, my setup looks like this:
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
Mydata_files = [('.', ['dict_lookup.txt'])]
setup(console=['BladeHost.pyw'],
options = {
"py2exe": {
'bundle_files': 1, #with this == 1, I have the weird CreateActCtx error msg
'compressed': True,
"dll_excludes": ["MSVCP90.dll", "gdiplus.dll"],
}
},
zipfile = None,
data_files=Mydata_files,
)
This setup gives me the executable and the dict_lookup.txt in the dist folder. However, I do not want this stupid .txt file outside of the executable. I know I copy and paste this text file into a long string inside the python script but that will make my python script ugly.
So my question is, is there a way to setup py2exe so that this .txt file is built into the executable?
Thanks for any help.