I've been searching through SO for a while now trying to come up with an answer to this but due to my inexperience with programming I don't understand much of the documentation, nor am I confident enough to experiment too much.
Would anyone be able to describe in slightly simpler terms how I would use programs like Py2exe, PyInstaller, cx_freeze etc.? I just want a way for others (mainly friends) to be able to run my (simple, text only) program without having to download python themselves. If there is an easier way to do this I'd appreciate knowing that too.
Running Vista 32bit, python 2.7
Using pyinstaller you can convert the python file to exe. Type pyinstaller <python-file-name>, this will convert the . py to .exe file with console. Add –no-console keyword after pyinstaller to convert python file to executable without command prompt.
You can just type pip install pyinstaller to install it and pyinstaller -w yourpythonscript.py to compile it to an exe.
There are two distinct ways of freezing python scripts to create executables:
The point where you have to start is reading the documentation. Such tools are not just push-and-run style tools, they usually have some configuration that must be implemented (that's the problem of possibly all build systems, and as the project grows, the configuration and number of hooks also grows).
You can start with Py2exe tutorial and 'hello-world' to get acquainted with that how compilation is done. As far as I know it's a simplest way to get your goal.
And the last thing, you can't create cross-platform native executables as their file formats are strongly operating system and hardware dependent.
from distutils.core import setup import py2exe setup(console=['Avril.py'])
cd C:\Python27\
python setup.txt py2exe
Source: Manvir Singh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With