From: Larry B. <lar...@we...> - 2006-08-23 20:58:25
|
Jeffrey Barish wrote: > I'm not sure that this technique even works, but in any case I'm not doing > it right. I have a file, myconfig.py, that contains configuration > information. The user should be able to edit the file, so it obviously > cannot be included in the library.zip as myconfig.pyc. I was thinking that > I could exclude the file and list it as a data_file, but I don't know > whether the interpreter in python24.dll can still deal with it then (as an > import). In any case, I am not getting the setup.py right. Here's what I > have: > > setup(console=['runAll.py'], > options={'runAll.py': {'excludes': ['myconfig.py']}}, > data_files=[('', ['myconfig.py'])]) > > I based the options line on something I found in the archive for this mail > list, but I must not have it right. I am getting myconfig.py in dist, but > I am not excluding it from library.zip. Put configuration data into a myconfig.ini file and parse with ConfigParser. The .ini file format is much more generally understood by users than python code. Then it becomes a data file that is included. Actually I don't include these files in my py2exe setup script. I include them (and any other data files) in my Inno Installer setup script. Inno builds me a single setup.exe with appropriate versioning, uninstaller, etc. that is much easier to distribute to end users. Note: Before you say that there are too many parameters to put into a .ini file and have it processed efficiently, try it. I have .ini files that have THOUSANDS of parameters in them and they are parsed VERY quickly. Hope info helps. Larry Bates |