Process to convert simple Python script into Windows executable [duplicate]
PyInstaller will create a single-file executable if you use the --onefile
option (though what it actually does is extracts then runs itself).
There's a simple PyInstaller tutorial here. If you have any questions about using it, please post them...
Using py2exe, include this in your setup.py:
from distutils.core import setupimport py2exe, sys, ossys.argv.append('py2exe')setup( options = {'py2exe': {'bundle_files': 1}}, windows = [{'script': "YourScript.py"}], zipfile = None,)
then you can run it through command prompt / Idle, both works for me. Hope it helps
i would recommend going to http://sourceforge.net/projects/py2exe/files/latest/download?source=files to download py2exe. Then make a python file named setup.py. Inside it, type
from distutils.core import setupimport py2exesetup(console=['nameoffile.py'])
Save in your user folderAlso save the file you want converted in that same folder
Run window's command prompttype in setup.py install py2exe
It should print many lines of code...
Next, open the dist folder.
Run the exe
file.
If there are needed files for the program to work, move them to the folder
Copy/Send the dist folder to person.
Optional: Change the name of the dist folder
Hope it works!:)