Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > py2exe/wxpython demo

Reply
Thread Tools

py2exe/wxpython demo

 
 
Bryan
Guest
Posts: n/a
 
      06-06-2004
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
 
Reply With Quote
 
 
 
 
Thomas Heller
Guest
Posts: n/a
 
      06-07-2004
Bryan <(E-Mail Removed)> 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


 
Reply With Quote
 
 
 
 
Bryan
Guest
Posts: n/a
 
      06-07-2004
Thomas Heller wrote:
> Bryan <(E-Mail Removed)> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wxPython demo /Process does not open new demo Andy Leszczynski Python 1 02-18-2005 06:03 PM
PyOpenGL demo in wxPython demo crashes F. GEIGER Python 9 05-03-2004 04:43 PM
Digilent Spartan II demo board push button Clyde VHDL 2 02-15-2004 08:18 PM
Macromedia Flash Player Plugin problem with Intel Demo pd Firefox 1 02-09-2004 08:43 AM
Tool for connecting modules,download free,quick demo Song VHDL 0 11-17-2003 03:35 PM



Advertisments