471,078 Members | 830 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,078 software developers and data experts.

py2exe/wxpython demo

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. in case you aren't aware, the .py files in the demo directory is used both
as a data file which is why i added them in the data_files section, and also as python scripts which needs to be added
in the library.zip file. the --includes argument on the command line will correctly compile and place the .pyc files in
the library.zip, there must be a better way that having to added them all explicitly on the command line.

thanks,

bryan
Jul 18 '05 #1
2 1929
Bryan <be*****@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
Jul 18 '05 #2
Thomas Heller wrote:
Bryan <be*****@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


thanks! worked perfectly :)

bryan

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by RJS | last post: by
2 posts views Thread by Stefan Behrens | last post: by
reply views Thread by Marco Aschwanden | last post: by
1 post views Thread by Thomas Heller | last post: by
6 posts views Thread by zdp | last post: by
9 posts views Thread by Isaac Rodriguez | last post: by
1 post views Thread by Jimmy Retzlaff | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.