py to exe: suggestions?

C

chris patton

I need to convert a python file to an '.exe'. I've tried py2exe, and I
don't like it because you have to include that huge dll and libraries.

Thanks for the Help!!
 
S

Sybren Stuvel

chris patton enlightened us with:
I need to convert a python file to an '.exe'. I've tried py2exe, and
I don't like it because you have to include that huge dll and
libraries.

Then what would you expect? The whole Python interpreter is needed if
you want to run Python programs. It's more a smart packaging process
than a compilation of Python code into an executable.

Sybren
 
B

Ben Finney

chris patton said:
I need to convert a python file to an '.exe'.

A Python program is executable only in the context of a Python
interpreter. Python is a dynamic language; it can't be compiled to
native machine code.
I've tried py2exe, and I don't like it because you have to include
that huge dll and libraries.

That's the Python interpreter environment, and the standard Python
library that is made available in the Python environment. Without
them, your program isn't executable.

What were you hoping for?
 
B

Bugs

If your users already have Python installed then you could just create a
self-extracting, self-executing .exe that contains only your scripts and
necessary files. I belive many of the popular zip utilities have the
ability to do this. The free info-zip does this as well:
http://www.info-zip.org (but you have to recompile it with the
appropriate switch turned on).

If they don't have Python installed then you have no choice but to
include the python DLLs, libraries, etc. as that's your runtime
environment necessary to run your Python application.

HTH
 
R

Ron Adam

chris said:
I need to convert a python file to an '.exe'. I've tried py2exe, and I
don't like it because you have to include that huge dll and libraries.

Thanks for the Help!!

Do you want to create an exe to give to others, or so that you can use
it in windows easier just like any other exe?

If the later you may be able to tell py2exe to exclude dll's that are in
your search path.

If you want something you can send to other windows users, then it's far
easier to include the dll's and extra files than it is to try and make
sure all the files the programs needs are installed correctly on the
recipients computer.

I use:

py2exe - to create the main exe and gather all the needed files together.

Inno Setup - to create a windows installer complete with license, docs,
Internet support links, and an uninstaller.

And a few other programs such as an icon editor to create icons, and
Resource Hacker to change the tk window icons to my own. Py2exe will
insert the exe icon, but not change the little tk window icons which
reside in the tk dll files.

When it's all done you have an installable application from a single exe
file that's very professional. Most users won't need to know or care
what language you developed your application with as long as it works.

Hope that helps,
Cheers,
Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,318
Members
47,998
Latest member
GretaCjy4

Latest Threads

Top