Let's say that I write a program in Python that uses wxPython. If I want my completed project to eventually run on someone else's computer, someone who probably isn't a programmer, what is this easiest way to do this?
Furthermore, if I package the Python script somehow, do I have to also include all of the modules that it was dependent on to run?
For example, if I import os
and import wx
, do the os
and wx
files have to be included in my final package?
You will want to use one of the following utilities:
- py2exe
- cx_freeze
- bb_freeze
- PyInstaller
The py2exe project hasn't been updated in a few years, so one of the others might be better. I wrote up tutorials on these that you are welcome to check out:
- http://www.blog.pythonlibrary.org/2010/07/31/a-py2exe-tutorial-build-a-binary-series/
- http://www.blog.pythonlibrary.org/2010/08/19/a-bbfreeze-tutorial-build-a-binary-series/
- http://www.blog.pythonlibrary.org/2010/08/12/a-cx_freeze-tutorial-build-a-binary-series/
- http://www.blog.pythonlibrary.org/2010/08/10/a-pyinstaller-tutorial-build-a-binary-series/
There is also a project called GUI2Exe which slaps a GUI front-end on all of these binary creation utilities and makes using them a bit easier. You can read about that on my blog too:
Let's say that I write a program in Python that uses wxPython. If I want my completed project to eventually run on someone else's computer, someone who probably isn't a programmer, what is this easiest way to do this?
Furthermore, if I package the Python script somehow, do I have to also include all of the modules that it was dependent on to run?
For example, if I import os
and import wx
, do the os
and wx
files have to be included in my final package?
You will want to use one of the following utilities:
- py2exe
- cx_freeze
- bb_freeze
- PyInstaller
The py2exe project hasn't been updated in a few years, so one of the others might be better. I wrote up tutorials on these that you are welcome to check out:
- http://www.blog.pythonlibrary.org/2010/07/31/a-py2exe-tutorial-build-a-binary-series/
- http://www.blog.pythonlibrary.org/2010/08/19/a-bbfreeze-tutorial-build-a-binary-series/
- http://www.blog.pythonlibrary.org/2010/08/12/a-cx_freeze-tutorial-build-a-binary-series/
- http://www.blog.pythonlibrary.org/2010/08/10/a-pyinstaller-tutorial-build-a-binary-series/
There is also a project called GUI2Exe which slaps a GUI front-end on all of these binary creation utilities and makes using them a bit easier. You can read about that on my blog too:
0 commentaires:
Enregistrer un commentaire