I have a wxPython application that is almost done & I would like to place it in my portfolio. I have to consider when someone attempts to run my app that they 开发者_如何学JAVAmay not have Python, or wxPython, so if they just click the main script/python file its not going to run, right?
How should I distribute my app (how do you distribute ur apps) so that it can be run & also so that it could be run on the 3 major OS's (Unix, Windows, MacOSX)?
I know of py2exe for releasing under windows, but what can I use for Unix & MacOSX to compile the program? Whats the easiest way?
Use Gui2exe and compress with UPX to get unpacked size down.
For a setup file(exe) with uinstall info Inno-Setup is good.
I have use this with wxpython several times and got it to work on all windows versions.
For Gui2exe use optimize(2) - compressed(2) - Bundle files(3)
Bundle files(3) is the most stable, Bundle files(1) make one big exe-file. For one exe-file is better as last step to use Inno-Setup
You can use py2exe for Windows and py2app for Mac. PyInstaller works for Windows and Linux. Personally, I use GUI2Exe, which wraps all three and makes them a little easier to use. Note: I don't have a Mac, so I haven't tried it with that. You can check out my series on freezing Python here:
http://www.blog.pythonlibrary.org/2010/08/10/a-pyinstaller-tutorial-build-a-binary-series/
http://www.blog.pythonlibrary.org/2010/07/31/a-py2exe-tutorial-build-a-binary-series/
http://www.blog.pythonlibrary.org/2010/08/31/another-gui2exe-tutorial-build-a-binary-series/
There are a couple others on the blog too.
I suggest both, script for all platforms and frozen binary for lazy windows users.
To answer your latest question, you don't compile python. Python is an interpreted language, it gets compiled on the fly when run. A python frozen binary is actually the python interpreter with your script hardcoded in it. And frozen binaries are windows-only, AFAIK. Besides, Unix and MacOS (usually) come with python pre-installed.
精彩评论