473,804 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compiling wxPython app for Windows; Single EXE

Hi

I browsed the archives, but since some messages date back a bit, I
wanted to make sure that

- py2exe is still the best tool in town to compile Python scripts to
run on a Windows host that doesn't have Python installed, including
wxWidgets/wxPython

- there's no way to build a single EXE, to make deployment easier (if
multiple files, I need to build an installer with eg. NSIS or
InnoSetup)?

Thank you.
Aug 13 '06 #1
10 3958

Vincent Delporte wrote:
Hi

I browsed the archives, but since some messages date back a bit, I
wanted to make sure that

- py2exe is still the best tool in town to compile Python scripts to
run on a Windows host that doesn't have Python installed, including
wxWidgets/wxPython

- there's no way to build a single EXE, to make deployment easier (if
multiple files, I need to build an installer with eg. NSIS or
InnoSetup)?

Thank you.
Hi,

I have a wxPython app, which I compile into one EXE file. Then there's
just 1 support file needed: a MS DLL (which, once distributed, you will
not need to update).
Oh, and for w9x support there's an extra file, popenw9x.exe (or
something like that) which you can probably forget about if you don't
wish to support that.

Well, OK, that makes 3 files... Icons for windows are extra too, and
any other setup/ini/datafiles you wish to add and that are opened as
'normal' files too.

So what I do then is bundle it up as an self-extracting-archives, using
7-zip, which by default extracts into a sub-directory of the directory
where you copy the SEA-exe.

Voila, simple and easy, no installer required.

Works for me; dunno if it's good enough for your needs as well. (Oh,
and creating the SEA-exe you can probably automate if from the setup.py
but I haven't bothered yet)

Cheers and good luck,

--Tim

Aug 13 '06 #2
On 13 Aug 2006 13:46:14 -0700, "Tim N. van der Leeuw"
<ti************ *@nl.unisys.com wrote:
>I have a wxPython app, which I compile into one EXE file. Then there's
just 1 support file needed: a MS DLL (which, once distributed, you will
not need to update).
OK. So you compile the Python app into an EXE using py2exe, and then
use eg. 7Zip to combine all the files into a single EXE, that
1. uncompresses itself in the directory validated by the user
2. when done, runs the Python EXE?
Aug 13 '06 #3
Vincent Delporte wrote:

<snip>
- there's no way to build a single EXE, to make deployment easier (if
multiple files, I need to build an installer with eg. NSIS or
InnoSetup)?
I am using InnoSetup. The included example script (I believe in py2exe) is
adequate for simple applications. I just modified a few lines and I had a
neat Windows Installer.

Satya

--
Posted via a free Usenet account from http://www.teranews.com

Aug 14 '06 #4
Satya wrote:
Vincent Delporte wrote:

<snip>
>- there's no way to build a single EXE, to make deployment easier (if
multiple files, I need to build an installer with eg. NSIS or
InnoSetup)?

I am using InnoSetup. The included example script (I believe in py2exe) is
adequate for simple applications. I just modified a few lines and I had a
neat Windows Installer.

Satya
+1 on the Inno Installer solution. I use it a lot and it is both
easy to use and flexible for distributing Python apps on Windows.
While just compressing into self-extracting .exe works for simple
apps, there always seem to be "other" things you want to do. Things
like modifying .ini files, setting up shortcuts and icons on user's
desktop, start list, quickstart list. Registering dlls, starting
services, ... Inno Installer can help you with all these things.
The combination of py2exe and Inno Installer is hard to beat.

-Larry Bates
Aug 14 '06 #5
Vincent Delporte wrote:
- py2exe is still the best tool in town to compile Python scripts to
run on a Windows host that doesn't have Python installed, including
wxWidgets/wxPython
Hi Vincent and c.l.p-ers

I'm using PyInstaller (http://pyinstaller.hpcf.upr.edu/) precisely to
"compile" a wxPython-based program. So I'm curious about what makes
py2exe "the best tool...", because I'm about to miss that due to my
ignorance. I learned PyInstaller for something else and laziness kept
me from trying py2exe. Now, the blurb on py2exe's site doesn't sound
better than what I have with PyInstaller.

FWIW, PyInstaller (NB: it's an exe-maker, not an installer) can
compress your binaries using UPX, create single file executables and
works cross-platforms too. It'll even include w9xpopen.exe and allow
custom icons for the executable. It doesn't need setup.py. My
"buildtest. bat" is:

python Makespec.py -X -F -o ecoz ecotools.py grid.py similarity.py
diversity.py
python -O Build.py ecoz\ecotools.s pec >pyinstaller_lo g.txt
ecoz\ecotools.e xe test

I've notice that application start time (or rather, 're-start', as it's
more noticeable for the subsequent runs) is much better for the "single
directory" method, because single file will always decompress to a
temporary directory.

All the best,
Daniel

Aug 14 '06 #6
On 14 Aug 2006 09:39:02 -0700, "ajaksu" <aj****@gmail.c omwrote:
>I'm using PyInstaller (http://pyinstaller.hpcf.upr.edu/) precisely to
"compile" a wxPython-based program. So I'm curious about what makes
py2exe "the best tool...", because I'm about to miss that due to my
ignorance.
I didn't know about PyInstaller. I'll check it out. Thanks.
Aug 14 '06 #7
Vincent Delporte wrote:
Hi

I browsed the archives, but since some messages date back a bit, I
wanted to make sure that

- py2exe is still the best tool in town to compile Python scripts to
run on a Windows host that doesn't have Python installed, including
wxWidgets/wxPython

- there's no way to build a single EXE, to make deployment easier (if
multiple files, I need to build an installer with eg. NSIS or
InnoSetup)?

Thank you.
Hi,

Yes there is a way to make one .exe/.msi for everything ... but it does
require purchasing a tool such as VC++.

I have python + wxWindows + my stuff + many other libraries in one installer
(takes 120 Megs (sigh))

Philippe

Aug 14 '06 #8
On Mon, 14 Aug 2006 17:46:11 -0500, Philippe Martin
<pm*****@snakec ard.comwrote:
>Yes there is a way to make one .exe/.msi for everything ... but it does
require purchasing a tool such as VC++.

I have python + wxWindows + my stuff + many other libraries in one installer
(takes 120 Megs (sigh))
I know. An empty frame with wxPython runs at ... 12MB :-/
Aug 15 '06 #9
Daniel,

I am using py2exe since more then 4 years, so I am rather biased.

I read PyInstaller page and was positively impressed by the manual and
all the good words.
There is one major difference which will keep me with py2exe:

with PyInstaller and single file there is:
"When first started, it finds that it needs to extract these files
before it can run "for real"."

and with py2exe:
Changes in 0.6.1:

* py2exe can now bundle binary extensions and dlls into the
library-archive or the executable itself. This allows to
finally build real single-file executables.

The bundled dlls and pyds are loaded at runtime by some special
code that emulates the Windows LoadLibrary function - they are
never unpacked to the file system.

this "they are never unpacked to the file system" is the USP of py2exe
to me at the moment.

What is less then optimal with both packages, is that MSVCR71.DLL needs
to be distributed separately :(

Harald

Aug 15 '06 #10

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

Similar topics

15
2914
by: Grant Edwards | last post by:
Can anybody recommend a good book on wxPython? Are there any books on wxPython? I've been trying to learn wxPython and/or wax for a few weeks, and I'm just not getting it. wxWindows seems to be more low-level than the other GUI toolkits I've used (Tk, GTK, and Trestle), and there are all sorts exposed details in wxWindows/wxPython that I find weird.
25
3363
by: BJörn Lindqvist | last post by:
See: http://www.wxpython.org/quotes.php. especially: "wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard Python GUI toolkit is that Tkinter was there first." - Guido van Rossum Guess, that answers my question, but isn't "Tkinter was there first" a very bad answer? :) It is kinda ugly too, so I wonder why it can't be replaced? Or maybe another GUI...
6
2938
by: Zunbeltz Izaola | last post by:
Hi, I have the following problem. I'm developing a GUI program (wxPython). This program has to comunicate (TCP) whit other program that controls a laboratory machine to do a measurement. I have a dialog box, wiht two buttoms "Start measurement" and "Stop". "Start" executes a function that do the measurement in the following way.
25
4288
by: TPJ | last post by:
GUI's etc: PyGtk on Windows "(...) So if someone develops mainly for X and just wants to make sure that it is not impossible to run on Windows, you can use PyGTK. (...)", July 2nd, 1999 pyGTK on Windows "(...) > can i use pyGTK under > Windows???
22
5064
by: Glurt Wuntal | last post by:
I am a newbie with Python. It's a great language, but I would like to be able to present a simple gui menu for some of my scripts; something better than using 'raw_input' prompts. Any recommendations for a program that will allow me to create the gui screens? Something useable in Linux. thanks.
0
13480
bartonc
by: bartonc | last post by:
You can find the original author of the script by ggling " Py2Exe version 6.3 setup" The cool thing about this is that it calls py2exe, just in case you're uncomfortable with the command line. I had to search hi and lo for the example of how to exclude Tkinter. Coming soon: scipy includes and numpy include that gets rid of complaints of missing modules that are fantom errors. # Py2Exe version 6.3 setup file for wxPython GUI programs. #...
8
3726
by: Janwillem | last post by:
Is there a way to force the wx.FileDialog to show as default the thumbnails vie in stead of list view? thanks, janwillem
4
2824
by: python | last post by:
I'm looking at rewriting some legacy VB applications and am pondering which of the following techniques to use: 1. Browser based GUI with local web server (Browser + wsgiref.simple_server) (I'm assuming that simple_server is class I want to build from for a local web server) -OR- 2. wxPython based GUI
0
1031
by: Leo Lee | last post by:
Hi, I think I have already solved this problem while I am digging into the installation sources. I found this: C:\Python25\Lib\site-packages\py2exe\samples\singlefile\gui\setup.py # Requires wxPython. This sample demonstrates: # # - single file exe using wxPython as GUI.
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9177
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.