rdodev
rdodev

Reputation: 3202

Building a Windows executable from python source

We have a Py module we'd like to give to users in the form of a windows executable. Is there a good tried and true tool to package a py module to Windows exe?

Upvotes: 1

Views: 268

Answers (3)

pR0Ps
pR0Ps

Reputation: 2802

As an alternative to py2exe if you're running a 3.x version of Python, you can use cx_freeze (http://cx-freeze.sourceforge.net/). It doesn't package the program into a single executable, but you can package all the files it generates into a self-extracting archive for deployment. See https://stackoverflow.com/a/11511735/369977 for details.

Upvotes: 2

Gunnar
Gunnar

Reputation: 2725

You can use Python extention py2exe.

In Python you can use the code:

from distutils.core import setup
import py2exe

setup(console=['test.py'])

to make the executable test.exe

Upvotes: 1

Jakob Bowyer
Jakob Bowyer

Reputation: 34718

from distutils.core import setup
import py2exe

setup(console=['hello.py'])

So long as you have py2exe installed it will compile hello.py to an exe, (it actually just bundles the stdlib and interpreter into an executable.)

Upvotes: 0

Related Questions