This script build a Python script (.py
) to Windows executable (.exe
).
The output executable can be run:
- regardless Windows versions,
- without Python installation,
- without module installation.
This script not yet supported on Windows x64 :
running py2exe
error: bundle-files 1 not yet supported on win64
This script depends only to py2exe module.
To dowload this module:
To show help message:
python build.py -h
python build.py --help
It shows this message:
usage: build.py [-h] [-v] scriptfile
positional arguments:
scriptfile the input script file
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
The script to compile is specified when calling the executable in command line, in the first argument:
python pathToBuild/build.py pathToArchivage/prog.py
To build a script (here it's script.py
for this example) into the current folder:
python build.py script.py
The executable is located in the current folder, under the same name but with exe
extension (here script.exe
).