ANN: wxPython 2.8.10.1

Christopher Barker wrote:

Chris Spencer wrote:

I am using the "single executable" mode, definitely. This is a
requirement of my project. If you need me to split it out for testing
purposes, I can definitely TEST the theory, but in production I need a
single executable.

why is that? I agree that it is nice, but I've found that as soon as I get beyond a trivial app, there is always SOMETHING else I need to include. The MS dlls if nothing else.

Once you've got more than one file, what's a few hundred :wink:

You can put all the .py and .pyd files inside a directory to make things a bit cleaner for your users.

INNO is also able to compress it significantly smaller when not in single-executable mode, for some reason.

Paul

Chris Spencer wrote:

I am using the "single executable" mode, definitely. This is a
requirement of my project. If you need me to split it out for testing
purposes, I can definitely TEST the theory, but in production I need a
single executable.

Yes, please do test it.

···

--
Robin Dunn
Software Craftsman

Robin,

Robin Dunn wrote:

Chris Spencer wrote:

I am using the "single executable" mode, definitely. This is a
requirement of my project. If you need me to split it out for testing
purposes, I can definitely TEST the theory, but in production I need a
single executable.

Yes, please do test it.

I had tried 'bundle=1 and 2' and could not get it to work with Py2.6 (get what seems to be the "standard" error with SxS - app not correctly installed), as I always use 'bundle=3' and create a "lib/library.zip" I frankly did not try to hard.

The setup which works for me, generated on Vista and tested on XP is on the wiki:

http://wiki.wxpython.org/py2exe

and the corresponding InnoSetup script is here:

http://wiki.wxpython.org/InnoSetup

Anyone please feel free to make comments on all these pages, there definitely need some more work (hopefully next week), so if I get comments that would be great.

Werner

Anyone please feel free to make comments on all these pages, there
definitely need some more work (hopefully next week), so if I get comments
that would be great.

FYI I have already worked around this annoying SxS problem on Windows
and Python2.6 with wxPython. I have been using wxPython with Python
2.6 on both Windows and Linux for some time now without any
difficulty. You can test it for yourself using the sample that is
provided with cx_Freeze (samples/wx). This is the correct link for
cx_Freeze (the one referenced in one of the pages is old)

http://cx-freeze.sourceforge.net

The sample setup.py looks as follows:

import sys

from cx_Freeze import setup, Executable

base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(
        name = "hello",
        version = "0.1",
        description = "Sample cx_Freeze wxPython script",
        executables = [Executable("wxapp.py", base = base)])

Note that this is set up for both Windows and Linux. If you just want
Windows you can simplify as follows:

from cx_Freeze import setup, Executable

setup(
        name = "hello",
        version = "0.1",
        description = "Sample cx_Freeze wxPython script",
        executables = [Executable("wxapp.py", base = "Win32GUI")])

If you have any questions about this, let me know and I'd be happy to
answer them.

Anthony

Hi Werner,

Robin,

Robin Dunn wrote:

Chris Spencer wrote:

I am using the "single executable" mode, definitely. This is a
requirement of my project. If you need me to split it out for testing
purposes, I can definitely TEST the theory, but in production I need a
single executable.

Yes, please do test it.

I had tried 'bundle=1 and 2' and could not get it to work with Py2.6 (get
what seems to be the "standard" error with SxS - app not correctly
installed), as I always use 'bundle=3' and create a "lib/library.zip" I
frankly did not try to hard.

The setup which works for me, generated on Vista and tested on XP is on the
wiki:

py2exe - wxPyWiki

and the corresponding InnoSetup script is here:

InnoSetup - wxPyWiki

Anyone please feel free to make comments on all these pages, there
definitely need some more work (hopefully next week), so if I get comments
that would be great.

I do have a couple of questions, I remember I have already asked them
but I probably didn't understand your answers. In the py2exe page, you
mention the MS manifest. With Python 2.5, it's very easy to
automatically generate a manifest, no special information is required.
But as I am trying to understand how to support Python 2.6/Vista in
GUI2Exe, I need to find a way to generate the manifest file or copy it
from somewhere: can I just copy it from somewhere in the filesystem?
If the answer is yes, from where? (I don't have Vista and I am
explicitly avoiding the upgrade to Python 2.6). Otherwise, where do I
get the Microsoft.VC90.CRT version and publicKeyToken numbers?

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Thu, May 21, 2009 at 10:07 AM, Werner F. Bruhin wrote:

Andrea Gavana wrote:

I do have a couple of questions, I remember I have already asked them
but I probably didn't understand your answers. In the py2exe page, you
mention the MS manifest. With Python 2.5, it's very easy to
automatically generate a manifest, no special information is required.
But as I am trying to understand how to support Python 2.6/Vista in
GUI2Exe, I need to find a way to generate the manifest file or copy it
from somewhere: can I just copy it from somewhere in the filesystem?
If the answer is yes, from where? (I don't have Vista and I am
explicitly avoiding the upgrade to Python 2.6).

One possibility is to extract the manifest from the python.exe or maybe wxPython's _core_.pyd module (Py26 version in both cases) using ctypes. There is an example of updating an embedded manifest here, you can probably do something similar to extract a manifest:
wxTrac has been migrated to GitHub Issues - wxWidgets

···

--
Robin Dunn
Software Craftsman

Hi Andrea,

Andrea Gavana wrote:
...

I do have a couple of questions, I remember I have already asked them
but I probably didn't understand your answers. In the py2exe page, you
mention the MS manifest.

Take it all with a grain of salt, as I am definitely not an expert in all this.

My current understanding/finding is that the appname.manifest is not needed anymore as of 2.6 as Robin does this internally as of this release. But it doesn't seem to hurt either if one still includes it.

In addition one needs the Microsoft.VC90.CRT.manifest file, one can either install this and the corresponding dll's into a folder called "Microsoft.VC90.CRT" in the app folder or just copy them next to the app (the later works also on W2K), if one uses the py2exe option to store things in a folder e.g. "lib" then a second copy needs to be copied to this folder. BTW, if one uses InnoSetup to create the installer this is no issue as it figures out that they are the same files and only includes them once in the installer and on installation extracts them twice.

With Python 2.5, it's very easy to
automatically generate a manifest, no special information is required.
But as I am trying to understand how to support Python 2.6/Vista in
GUI2Exe, I need to find a way to generate the manifest file or copy it
from somewhere: can I just copy it from somewhere in the filesystem?
If the answer is yes, from where? (I don't have Vista and I am
explicitly avoiding the upgrade to Python 2.6). Otherwise, where do I
get the Microsoft.VC90.CRT version and publicKeyToken numbers?
  

I think Robin's suggestion of using ctypes to extract the manifest would be the most elegant. I had a quick look at it and tried to adapt the script to instead of updating to just "FindResource" but I can not make it work - probably because this is way over my head.

Werner

Anthony,

Anthony Tuininga wrote:

Anyone please feel free to make comments on all these pages, there
definitely need some more work (hopefully next week), so if I get comments
that would be great.
    
FYI I have already worked around this annoying SxS problem on Windows
and Python2.6 with wxPython. I have been using wxPython with Python
2.6 on both Windows and Linux for some time now without any
difficulty. You can test it for yourself using the sample that is
provided with cx_Freeze (samples/wx). This is the correct link for
cx_Freeze (the one referenced in one of the pages is old)

http://cx-freeze.sourceforge.net
  

Only found it on the following page.
http://wiki.wxpython.org/CreatingStandaloneExecutables

Fixed it.

The sample setup.py looks as follows:

import sys

from cx_Freeze import setup, Executable

base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(
        name = "hello",
        version = "0.1",
        description = "Sample cx_Freeze wxPython script",
        executables = [Executable("wxapp.py", base = base)])

Note that this is set up for both Windows and Linux.

When I "build" using the above for the samplewx.py script I used on for the py2exe sample I get an exe and files in build\exe.win32-2.6 which runs fine on my build machine.

However if I try to run it on my XP test machine I get the error "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.", but it works fine if I try it on W2K.

I got it to work on the XP machine by adding the "Microsoft.VC90.CRT.manifest" to the "build\exe.win32-2.6" folder (the one I show on here py2exe - wxPyWiki ).

Will try and write a page based on this for the wiki sometimes next week.

Werner

Anthony,

Anthony Tuininga wrote:

Anyone please feel free to make comments on all these pages, there
definitely need some more work (hopefully next week), so if I get
comments
that would be great.

FYI I have already worked around this annoying SxS problem on Windows
and Python2.6 with wxPython. I have been using wxPython with Python
2.6 on both Windows and Linux for some time now without any
difficulty. You can test it for yourself using the sample that is
provided with cx_Freeze (samples/wx). This is the correct link for
cx_Freeze (the one referenced in one of the pages is old)

http://cx-freeze.sourceforge.net

Only found it on the following page.
CreatingStandaloneExecutables - wxPyWiki

Fixed it.

Thanks.

The sample setup.py looks as follows:

import sys

from cx_Freeze import setup, Executable

base = None
if sys.platform == "win32":
base = "Win32GUI"

setup(
name = "hello",
version = "0.1",
description = "Sample cx_Freeze wxPython script",
executables = [Executable("wxapp.py", base = base)])

Note that this is set up for both Windows and Linux.

When I "build" using the above for the samplewx.py script I used on for the
py2exe sample I get an exe and files in build\exe.win32-2.6 which runs fine
on my build machine.

However if I try to run it on my XP test machine I get the error "This
application has failed to start because the application configuration is
incorrect. Reinstalling the application may fix this problem.", but it works
fine if I try it on W2K.

I got it to work on the XP machine by adding the
"Microsoft.VC90.CRT.manifest" to the "build\exe.win32-2.6" folder (the one I
show on here py2exe - wxPyWiki ).

Yes. You need to install the VC2008 redistributable or setup a private
assembly. That much cannot be changed. cx_Freeze took the default
approach that the redistributable has already been installed or can be
installed. The error message leaves a great deal to be desired but the
fault for that you can lay at Microsoft's feet. :slight_smile: Setting up a
private assembly as you did. To do that with cx_Freeze, use the
include_files option as in this:

includeFiles = [
        ("Microsoft.VC90.CRT.manifest", "Microsoft.VC90.CRT.manifest")
]
buildOptions = dict(
        include_files = includeFiles)

setup(
        name = "hello",
        version = "0.1",
        description = "Sample cx_Freeze wxPython script",
        options = dict(build_exe = buildOptions),
        executables = [Executable("wxapp.py", base = base)])

Hopefully that makes sense to you?

Will try and write a page based on this for the wiki sometimes next week.

Sure. If you have questions at that point, let me know.

Anthony

···

On Fri, May 22, 2009 at 4:10 AM, Werner F. Bruhin <werner.bruhin@free.fr> wrote:

Hi all,

....

2) In one of my programs (again, "compiled" with py2exe), I am
getting a strange debugging statement when running the executable from
the command line:

"""
16:11:41: Debug: src/helpers.cpp(140): 'CreateActCtx' failed with
error 0x000000
7b (the filename, directory name, or volume label syntax is
incorrect.).
"""

It doesn't seem to affect the functioning of my program, but I just
want to make sure I can ignore this and it won't bite me in the butt
in the future.

Just seeing very similar error.

Using Python 2.5.4, wxPython 2.8.10.1, py2exe'd on Windows XP.

The application works fine as far as I can see and I only see this error when running the "console" version, i.e. if I use the "windows" (py2exe) option then nothing shows.

Error is above, but with different text (0x000007b (not enough storage available to start process)

Has anyone found what the reason and resolution for this is?

Werner

···

On 17/05/2009 22:19, Chris Spencer wrote:

I've searched but I can't seem to find out the intended use case for Grid.DrawColLabel() and Grid.DrawColLabels().

I was hoping they'd be a method of hooking into the drawing of the column headers so I could draw to my own DC, but testing indicates that these methods are never automatically called.

So they must be intended for custom calling by my code, but when would be the appropriate place to call DrawColLabel(), so that the automatic drawing of the headers doesn't override my custom drawing of the headers?

I'm basing this message on brief testing of 2.8.10.1 on Mac.

Thanks!
Paul

···

On 5/16/09 10:31 PM, Robin Dunn wrote:

wx.grid.Grid: Added methods CalcRowLabelsExposed,
CalcColLabelsExposed, CalcCellsExposed, DrawRowLabels, DrawRowLabel,
DrawColLabels, and DrawColLabel to the Grid class.

From Python you could use these methods when catching the label windows' EVT_PAINT event. For example, if you wanted to have the default look of the labels and then draw something extra on top of it then you could bind EVT_PAINT, call one of the Draw*Label[s] methods and then do your custom drawing.

···

On 8/2/10 10:39 AM, Paul McNett wrote:

On 5/16/09 10:31 PM, Robin Dunn wrote:

wx.grid.Grid: Added methods CalcRowLabelsExposed,
CalcColLabelsExposed, CalcCellsExposed, DrawRowLabels, DrawRowLabel,
DrawColLabels, and DrawColLabel to the Grid class.

I've searched but I can't seem to find out the intended use case for
Grid.DrawColLabel() and Grid.DrawColLabels().

I was hoping they'd be a method of hooking into the drawing of the
column headers so I could draw to my own DC, but testing indicates that
these methods are never automatically called.

So they must be intended for custom calling by my code, but when would
be the appropriate place to call DrawColLabel(), so that the automatic
drawing of the headers doesn't override my custom drawing of the headers?

--
Robin Dunn
Software Craftsman

Thanks. Way back when, I tried catching EVT_PAINT and drawing my labels in the PaintDC there, but there were cross-platform issues (segfaults, IIRC). I think I'll give this a whirl again because the workaround I ended up with isn't pretty.

Paul

···

On 8/3/10 10:45 AM, Robin Dunn wrote:

On 8/2/10 10:39 AM, Paul McNett wrote:

On 5/16/09 10:31 PM, Robin Dunn wrote:

wx.grid.Grid: Added methods CalcRowLabelsExposed,
CalcColLabelsExposed, CalcCellsExposed, DrawRowLabels, DrawRowLabel,
DrawColLabels, and DrawColLabel to the Grid class.

I've searched but I can't seem to find out the intended use case for
Grid.DrawColLabel() and Grid.DrawColLabels().

I was hoping they'd be a method of hooking into the drawing of the
column headers so I could draw to my own DC, but testing indicates that
these methods are never automatically called.

So they must be intended for custom calling by my code, but when would
be the appropriate place to call DrawColLabel(), so that the automatic
drawing of the headers doesn't override my custom drawing of the headers?

From Python you could use these methods when catching the label
windows' EVT_PAINT event. For example, if you wanted to have the default
look of the labels and then draw something extra on top of it then you
could bind EVT_PAINT, call one of the Draw*Label[s] methods and then do
your custom drawing.

You may also want to look at the wx.lib.mixins.gridlabelrenderer module, which makes it easy to plugin renderer object similar to how cell renderers work.

···

On 8/3/10 11:28 AM, Paul McNett wrote:

On 8/3/10 10:45 AM, Robin Dunn wrote:

On 8/2/10 10:39 AM, Paul McNett wrote:

On 5/16/09 10:31 PM, Robin Dunn wrote:

wx.grid.Grid: Added methods CalcRowLabelsExposed,
CalcColLabelsExposed, CalcCellsExposed, DrawRowLabels, DrawRowLabel,
DrawColLabels, and DrawColLabel to the Grid class.

I've searched but I can't seem to find out the intended use case for
Grid.DrawColLabel() and Grid.DrawColLabels().

I was hoping they'd be a method of hooking into the drawing of the
column headers so I could draw to my own DC, but testing indicates that
these methods are never automatically called.

So they must be intended for custom calling by my code, but when would
be the appropriate place to call DrawColLabel(), so that the automatic
drawing of the headers doesn't override my custom drawing of the
headers?

From Python you could use these methods when catching the label
windows' EVT_PAINT event. For example, if you wanted to have the default
look of the labels and then draw something extra on top of it then you
could bind EVT_PAINT, call one of the Draw*Label[s] methods and then do
your custom drawing.

Thanks. Way back when, I tried catching EVT_PAINT and drawing my labels
in the PaintDC there, but there were cross-platform issues (segfaults,
IIRC). I think I'll give this a whirl again because the workaround I
ended up with isn't pretty.

--
Robin Dunn
Software Craftsman

Robin,

Any chance of changing the default path for the doc on Windows to:

C:\Python26\Doc\wxPython2.8 Docs and Demos - i.e. the Doc folder underneath the Python install

The current default is "Program Files" which means on Windows Vista and above this causes UAC errors with the demo (when one changes things).

Werner