== Introduction == How to generate a "exe" file with py2exe supporting gettext. == What Objects are Involved == [[http://starship.python.net/crew/theller/py2exe/|py2exe]] can be obtained from this site. == Just see how little is needed == The following are sample setup files for py2exe, they are located in your application directory. Should you use Boa Constructor you will then get additional options in the File menu when editing the setup.py file, e.g. if you select File/setup.py py2exe your "exe" will be generated in a "dist" directory. == setup.cfg code sample == Create a file "setup.cfg" in your program directory along the lines of the following example. * The package "encodings" is included below to prevent some errors when trying to run the "exe" on Python 2.3 * The package "kinterbasdb" is what I use for database access. {{{ #!python #distutils config file for a little application [py2exe] packages = encodings, kinterbasdb force_imports = encodings # we don't use docstrings at runtime, so we may as well prune them... optimize=2 # version information version_companyname = which ever version_filedescription = the little application name version_fileversion = 0.1.0 version_legalcopyright = Hmm... version_legaltrademarks = blah blah version_productname = the little applications product name version_productversion = 0.1.0 }}} == setup.py code sample == Create a file "setup.py" in your program directory along the lines of the following example. * The translation files (.mo) have to be defined in the "data_files" section, one entry for each language. I used the "ivcm" name for the domain as has been done on the other I18n pages. {{{ #!python # -*- coding: iso-8859-1 -*-# from distutils.core import setup import py2exe setup(name="the application name", scripts=["ivcm.py"], data_files=[("locale\\fr\\LC_MESSAGES", ["c:\\dev\\ivcm\\program\\locale\\fr\\LC_MESSAGES\\ivcm.mo"]), ("locale\\en\\LC_MESSAGES", ["c:\\dev\\ivcm\\program\\locale\\en\\LC_MESSAGES\\ivcm.mo"])], ) }}} === Comments === Please feel free to provide any type of feedback on this page to me at [werner.bruhin@free.fr]