py2exe/wxpython demo

Thomas Heller theller at python.net
Mon Jun 7 03:26:39 EDT 2004


Bryan <belred1 at yahoo.com> writes:

> just for fun and my own experience, i wanted to use py2exe to wrap the
> wxpython demo.   i put the setup script in the demo directory which is
> the following:
>
>
> from distutils.core import setup
> import glob
> import py2exe
>
> setup(windows=['demo.py'],
>        data_files=[('bitmaps', glob.glob('bitmaps/*.*')),
>                    ('data', glob.glob('data/*.*')),
>                    ('bmp_source', glob.glob('bmp_source/*.*')),
>                    ('', glob.glob('*.py'))],
>       )
>
>
>
>
> and ran the command like this:
>
>
> setup py2exe --ignores wx.BitmapFromImage,wx.EmptyIcon
>               --includes ActiveX_FlashWindow,ActiveX_IEHtmlWindow
>
>
> this was successful except for one thing... do i really have to
> explictly list every script file in the demo directory in the
> --includes argument on the command line? there are so many.  i was
> hoping to somehow be able to add it in the script as a glob, but
> nothing i did worked.

You can pass these to the setup function in an 'option' dictionary:

setup(....
      options={"py2exe": {"ignores":
                          ["wx.BitmapFromImage", "wx.EmptyIcon"],
                          "includes": ["ActiveX_FlashWindow", "..."]}},
      ...)

See also the wiki:

<http://starship.python.net/crew/theller/moin.cgi/PassingOptionsToPy2Exe>

Thomas





More information about the Python-list mailing list