py2exe and XRC

Hi,

I've been building an application using XRC and am using py2exe to make it all self-contained.

My problem is that the XRC files are all just referenced as paths in the python code, and therefore py2exe doesn't include them. Whats the standard way of incorporating the XRC in with everything else? I could simply include the files in with py2exe, but that seems messy.

Any ideas?

Cheers,
Jonathan

Jonathan Viney wrote:

Hi,

I've been building an application using XRC and am using py2exe to make it all self-contained.

My problem is that the XRC files are all just referenced as paths in the python code, and therefore py2exe doesn't include them. Whats the standard way of incorporating the XRC in with everything else? I could simply include the files in with py2exe, but that seems messy.

Any ideas?

You could embed the XRC file in a Python module as a string and then use LoadFromString(theString). That way py2exe will get your XRC just like any other python module.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn <robin@alldunn.com> writes:

Jonathan Viney wrote:

Hi,
I've been building an application using XRC and am using py2exe to
make it all self-contained.
My problem is that the XRC files are all just referenced as paths in
the python code, and therefore py2exe doesn't include them. Whats
the standard way of incorporating the XRC in with everything else? I
could simply include the files in with py2exe, but that seems messy.
Any ideas?

You could embed the XRC file in a Python module as a string and then
use LoadFromString(theString). That way py2exe will get your XRC just
like any other python module.

Ah, if this is possible, you could also use py2exe's ability to build
native windows resources into the executable and load it from there.
This saves you from recreating the Python file each time the xrc file
changes.

Thomas