Monday, 11 August 2014

How to create a single Windows executable from a Python script

We'll use py2exe for this purpose: http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/

Let's say we have a python script named test.py, and we want to create a single .exe file to run on Windows.

After the installation of the py2exe we create another .py script and run it.
Source code below:


It will create a single windows executable file out of our test.py script.