Bob Klahn wrote:
Hi Frank,
I have yet to use Gui2exe, or any of exe-creating tools it uses. So
I have a request: When you package your sudoku program using
Gui2exe, would you send me the files and info needed to do that? I
think that studying those would be a great way for me to learn how th
create Python/wxPython exe's.
Here's hoping!
Sure thing.
As I have not used Gui2exe or py2exe before, I thought I should learn how to
use py2exe first, just to make sure I understood the basics. For my little
program, it turned out to be so easy that I had no need to use Gui2exe at
all. Maybe with more complex scenarios Gui2exe would make life easier.
Following the tutorial on the py2exe web page, these were my steps.
1. Install py2exe on my computer.
2. Create a directory to store my program and any associated files.
3. Run the program to ensure that all imports are found correctly.
4. In the same directory, create a program called 'setup.py' -
from distutils.core import setup
import py2exe
setup(windows=['sudoku_solver.py'])
5. Run 'python setup.py py2exe'.
There is a lot of activity, and two new directories are created - 'build'
and 'dist'. 'dist' contains everything needed to run your program on another
computer, including a program called 'sudoku_solver.exe' which is used to
actually run the app. Total size of 'dist' - 17 files, about 16mb.
I tested it by cd'ing to 'dist' and running the executable - it just worked.
Then I copied the entire 'dist' directory onto a flash drive, plugged it
into another computer which was running XP but did not have python
installed, did the same, and it just worked. I am sure this is old hat for
most of you, but for me, that was an exciting moment!
HTH
Frank
Hi Frank,
Bob Klahn wrote:
Hi Frank,
I have yet to use Gui2exe, or any of exe-creating tools it uses. So I have a request: When you package your sudoku program using Gui2exe, would you send me the files and info needed to do that? I think that studying those would be a great way for me to learn how th create Python/wxPython exe's.
Here's hoping!
Sure thing.
As I have not used Gui2exe or py2exe before, I thought I should learn how to
use py2exe first, just to make sure I understood the basics. For my little
program, it turned out to be so easy that I had no need to use Gui2exe at
all. Maybe with more complex scenarios Gui2exe would make life easier.
Following the tutorial on the py2exe web page, these were my steps.
1. Install py2exe on my computer.
2. Create a directory to store my program and any associated files.
3. Run the program to ensure that all imports are found correctly.
4. In the same directory, create a program called 'setup.py' -
from distutils.core import setup
import py2exe
setup(windows=['sudoku_solver.py'])
5. Run 'python setup.py py2exe'.
There is a lot of activity, and two new directories are created - 'build'
and 'dist'. 'dist' contains everything needed to run your program on another
computer, including a program called 'sudoku_solver.exe' which is used to
actually run the app. Total size of 'dist' - 17 files, about 16mb.
I tested it by cd'ing to 'dist' and running the executable - it just worked.
Then I copied the entire 'dist' directory onto a flash drive, plugged it
into another computer which was running XP but did not have python
installed, did the same, and it just worked. I am sure this is old hat for
most of you, but for me, that was an exciting moment!
HTH
Frank
I thought that size sounded kind of high, so I ran it through GUI2exe 0.1 to see what would happen. I got 16 files at 12.8 MB. I tried it with GUI2Exe 0.3, but it was including the zip file for some reason and is giving me fits. Anyway, I think the difference in size is because I set the compression and optimize flags to 2 and I assume you just went with the defaults.
Mike
__________ Information from ESET NOD32 Antivirus, version of virus signature database 3953 (20090321) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com