1) Goto www.py2exe.org. download the package and install it. Even though you cannot see the installed py2exe in the startup folder, it gets stored whereever python is installed.
2) Next you would have to get your setup file ready to prepare the exe.
Below is the setup.py file. You would have to edit according to your preferences. For me xxx.py is the main program from which my other programs are called. So I put it there. distutils is a package in python, dont worry about that.
from distutils.core import setup
import py2exe
setup(console = [xxx.py])
3) Goto command prompt and run this command,
python setup.py py2exe
4) After you run the above command you get a series of lines on the console.
5) Finally you get two directories, build and dist in the current directory. You can go into the directory and you will find the .exe over here.
6) If you want you can delete the build directory.
In the next post, will explain how to use this exe to develop a setup using inno setup.
Leave a Reply