Make an *.EXE Using Python.

Nick Perkins nperkins7 at home.com
Wed Jul 18 23:34:44 EDT 2001


I am no expert, but here's how it worked for me:

First, you need to write a 'setup.py' script.  Here's one of mine:
My program is just the one file (mp3prog.py), so this very simple setup will
do the trick.


from distutils.core import setup
import py2exe

setup(name="mp3prog",
      scripts=["mp3prog.py"],
      )


This is in a file called 'setup.py', in the same dir as my prog.
Then you run this setup program, and give it the argument 'py2exe'.
To give the argument from the dos prompt, (not the >>> prompt) type:

python setup.py py2exe    (from the right directory)

If you run the setup.py script from within PythonWin, you can type 'py2exe'
in the dialog that pops up when you hit F5 (run).

The setup will run for a long time, produce a huge amount of text output,
including many error messages that you can ignore, and then produce a
directory containing some .dll's and an .exe


That is it.  You can run the .exe.  You can zip up the whole dir and send it
to your friend (who doesn't have python installed), and say "hey, here's a
program I wrote!"





"G. Willoughby" <thecalm at NOSPAM.btinternet.com> wrote in message
news:9j2en5$q15$1 at uranium.btinternet.com...
> have you any examples on how to use py2exe???
>
> Gary.
>
> "Nick Perkins" <nperkins7 at home.com> wrote in message
> news:E3K17.433170$eK2.87951585 at news4.rdc1.on.home.com...
> > You need py2exe:
> >
> > http://starship.python.net/crew/theller/py2exe/
> >
> >
> > "EricIDLE" <grayson-wilson at home.com> wrote in message
> > news:oAI17.647550$166.13393459 at news1.rdc1.bc.home.com...
> > > Hello,
> > > I was wondering is there a way to make a exe using Python?
> > > I seem to remeber vagely that there was a "Make EXE" choice under the
> file
> > > menu but its no longer there (If it ever was) so if you can give me a
> hand
> > > with this it would be great.
> > >
> > >
> >
> >
>
>





More information about the Python-list mailing list