473,385 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Converting a simple python script to a simple windows executable

Hi all,

I have a small python script that doesn't depend on anything except
the standard interpreter. I would like to convert it to a small .exe
file on Windows that can distributed alone without introducing
additional dependencies. I need to assume, because of other python
scripts, that anyone using this has python installed anyway so I hoped
it would be possible to do this. (Why I want to do this is a bit
involved but I can explain if necessary)

Unfortunately, it seems to be harder than it should be. I tried

(1) py2exe. This is really for when python isn't installed on the
remote user's machine, so it requires you to distribute a large amount
of DLLs etc which are part of the python installation. A bit silly
when I know that the remote user has python anyway.

(2) setuptools. This works but requires that the remote user installs
setuptools also. Something of a shame when I don't require any
installation procedure at the moment.

(3) create a small .bat file to call the python script and then try to
compile it to .exe. There are hundreds of bat2exe tools out there but
many of them seem to produce an executable that runs the script in a
separate command window, which differs from the .bat behaviour and
isn't what I want. That's not including the various freeware ones that
just fail and the large number of ones that want my money :)

Anyone have any better ideas?

Geoff Bache
Jun 27 '08 #1
5 1630
On Jun 11, 2:25 pm, geoffbache <geoff.ba...@jeppesen.comwrote:
Anyone have any better ideas?
How about ExeMaker?

http://effbot.org/zone/exemaker.htm

I have not used it but it seems to do what you want.

....
Jay

Jun 27 '08 #2
On Jun 11, 9:49*pm, jay graves <jaywgra...@gmail.comwrote:
On Jun 11, 2:25 pm, geoffbache <geoff.ba...@jeppesen.comwrote:
Anyone have any better ideas?

How about ExeMaker?

http://effbot.org/zone/exemaker.htm

I have not used it but it seems to do what you want.

...
Jay
Thanks, this looks very promising! Will try out a bit more tomorrow
but I think it should work.

Regards,
Geoff
Jun 27 '08 #3
On Wed, 11 Jun 2008 12:25:29 -0700, geoffbache wrote:
(1) py2exe. This is really for when python isn't installed on the remote
user's machine, so it requires you to distribute a large amount of DLLs
etc which are part of the python installation. A bit silly when I know
that the remote user has python anyway.
If you know the target user has Python installed, why don't you just
distribute the .pyw file? (Use ".pyw" instead of ".py" to avoid the extra
console window.)

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
Jun 27 '08 #4
On Jun 12, 4:04*am, William McBrine <wmcbr...@users.sf.netwrote:
On Wed, 11 Jun 2008 12:25:29 -0700, geoffbache wrote:
(1) py2exe. This is really for when python isn't installed on the remote
user's machine, so it requires you to distribute a large amount of DLLs
etc which are part of the python installation. A bit silly when I know
that the remote user has python anyway.

If you know the target user has Python installed, why don't you just
distribute the .pyw file? (Use ".pyw" instead of ".py" to avoid the extra
console window.)

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
I really like cx_freeze:

http://python.net/crew/atuining/cx_Freeze/
Jun 27 '08 #5

Thanks for all the suggestions. I have eventually used a heavily
edited version of ExeMaker which seems to do what I want.

Geoff
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Christian Long | last post by:
Hi I'm trying to pipe data into a python program on Windows 2000, on the command line. Like this: dir | myProgram.py Here's what I tried:
2
by: Sandeep Gupta | last post by:
Hi, I've written a commercial application that uses Python scripts for some of the functionality. Installing the Python portion of the application requires me to first install Python, and then...
5
by: Ben Finney | last post by:
Howdy all, I'm experimenting with carrying my personal computing environment around on a keychain USB flash storage device. I have the usual suspects on there: SSH keys, GPG keys, program...
47
by: Michael Scarlett | last post by:
There is an amazing article by paul graham about python, and an even better discussion about it on slashdot. The reason I point this out, is the more I read both articles, the more I realised how...
13
by: Darren Dale | last post by:
Some time ago I asked about executing a python program or script. For windows, I was informed that the .py extension could be added to some list of executable extensions, and then I could just type...
4
by: presentt | last post by:
Hello, I'm running Ubuntu Linux 5.04. I just started teaching myself Python today, and have been reading a few things to get started. I came across something in one (namely...
37
by: John Salerno | last post by:
I contacted my domain host about how Python is implemented on their server, and got this response: ------------------- Hello John, Please be informed that the implementation of python in our...
6
by: tatamata | last post by:
Hello. How can I run some Python script within C# program? Thanks, Zlatko
34
by: Ben Sizer | last post by:
I've installed several different versions of Python across several different versions of MS Windows, and not a single time was the Python directory or the Scripts subdirectory added to the PATH...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.