GUI2Exe ExamplesIntroductionHereafter I show a couple of examples on how to use GUI2Exe. Simple oneWe will build the sample file that comes with py2exe, on: /site-packages/py2exe/sample/singlefile/gui/test_wx.py - With the GUI opened, hit Ctrl+N or choose File => New project... ;
- Enter a name for the new project, i.e. "pyexe sample file";
- In the central window that appears, under the Target Class box, right click on the list control and select "Add item(s)";
- Left click on the new item in Exe Kind column and select "windows";
- Left click on the new item in the Python Main Script column and browse to search for the aforementioned file;
- On the Optimize, Compressed and Bundle Files drop down choices, choose 2, 2, 1 respectively;
- Scroll down the central window to the bottom and check the XP Manifest File option;
- Click on the Compile button.
And you're done. You can follow the compilation steps in the bottom log window as py2exe builds your executable.
Less simpler oneWe will build the wxPython demo as executable, using py2exe. - With the GUI opened, hit Ctrl+N or choose File => New project... ;
- Enter a name for the new project, i.e. "wxPython demo";
- In the central window that appears, under the Target Class box, right click on the list control and select "Add item(s)";
- Left click on the new item in Exe Kind column and select "windows";
- Left click on the new item in the Python Main Script column and browse to search for the file /YourPathToTheDemo/demo/Main.py;
- On the Optimize, Compressed and Bundle Files drop down choices, choose 2, 2, 1 respectively;
- Check the Dist Directory checkbox and write a new name for the distribution directory in the text box below (i.e., "py2exe");
- On the Packages list, hit Ctrl+A twice and edit the items to be wx and wx.lib respectively;
- On the Data Files list, hit Ctrl+A, browse with the file dialog to /YourPathToTheDemo/demo/bitmaps and select all the files. Do the same thing for the folders bmp_source and data.
- On the Data Files list, hit Ctrl+A, browse with the file dialog to /YourPathToTheDemo/demo and select all the files. In the dialog which will appear next simply write "." (a dot);
- Scroll down the central window to the bottom and check the XP Manifest File option;
- Click on the Compile button.
And you're done. You can follow the compilation steps in the bottom log window as py2exe builds your executable.
|
I have tried your second example with Python 2.6.2, wxPython 2.8.10.1 (msw-ansi), and py2exe 0.6.9 on a Windows Vista platform. I wrote a rather simple program that used wxPython and tried to create a executable that I could use on a Windows Vista platform. However, I get a warning/error during the compilation process:
C:\Python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarning?: the sets module is deprecated
How do I fix this problem?
Thank you, --V. P. Stokes