Introduction to py2exe

The py2exe project used to be the primary way to create Windows executables from your Python applications. The regular version of py2exe just supports Python 2.3-2.7. There is a new version listed on PyPI that will work with Python 3.4 as well. We will focus on the Python 2.x version, although this chapter should work with the Python 3 version too.

You have several choices for your application. You can create a program that only runs in a terminal, you can create a desktop graphical user interface (GUI) or you can create a web application. We will create a very simple desktop interface that doesn’t do anything except display a form that the user can fill out. We will use the wxPython GUI toolkit to help demonstrate how py2exe can pick up packages without us telling it to.

Get hands-on with 1200+ tech skills courses.