py2exe is a tool which turns .py to .exe (on Windows platform)

  1. Install py2exe at http://sourceforge.net/projects/py2exe/.

  2. Write a setup script for the specific python file. For example, if we want to turn helloworld.py into helloworld.exe, then we write a setup.py as follows:

    from distutils.core import setup
    import py2exe
    setup(console=['helloworld.py'])
    
  3. Run the following command:

    python setup.py py2exe
    

    The generated file for distribution will be in the folder dist.