Writing creation scripts for all of these is a nightmare, and for small projects (aren't they all when they are written in Python), it is too much of a hassle. At least Windows and Mac have standalone executable builders.
But what about the lonely Linux/UNIX? You could either require the user to download a bunch of python eggs that they don't have, install them, then run your script, only to find they have the wrong Python version; or you could bundle them all up with a handy little tool called: PyInstaller.
You're probably thinking, "Whoa, who does this guy think he is, breaking the UNIX file hierarchy like that?". Here is the deal, while it may be fine and dandy passing out source code and requiring users to download dependencies and such there are a few reasons you might not want to do it:
- Your source code is proprietary, I know, I know, proprietary stuff is evil, but it could happen!
- You want to distribute your code off-line and want to ensure all dependencies are satisfied.
- Your users cry when they see a command line.
- You like things in a clean, tidy, single executable.
- Download PyInstaller
- Extract it.
- cd to the extracted folder and run "python Configure.py"
- Run "python Makespec.py -F /path/to/your/script.py"
- Run "python Build.py /path/to/your/spec.spec" You should have received the location of the .spec file in the output of Makespec.py.
- Go have lunch, the executable is in a subdirectory of the PyInstaller directory.
No comments:
Post a Comment