FAQ
Hi !

I have an application that I compile to exe.

1.)
I want to compile main.ico into exe, or int zip. Can I do it ?

2.)
Can I compile the result to my specified directory, not into the dist ?
I want to structure my projects like this:
\src\
python codes, etc.
\res\
icons, etc
\bin\
the compiled version (exe, bins)
Can I do it with py2exe ?

Thanx for the help:
dd

Ps:
The setup file is:
# A setup script showing advanced features.
#
# Note that for the NT service to build correctly, you need at least
# win32all build 161, for the COM samples, you need build 163.
# Requires wxPython, and Tim Golden's WMI module.

# Note: WMI is probably NOT a good example for demonstrating how to
# include a pywin32 typelib wrapper into the exe: wmi uses different
# typelib versions on win2k and winXP. The resulting exe will only
# run on the same windows version as the one used to build the exe.
# So, the newest version of wmi.py doesn't use any typelib anymore.

from distutils.core import setup
import py2exe
import sys

# If run without args, build executables, in quiet mode.
if len(sys.argv) == 1:
sys.argv.append("py2exe")
sys.argv.append("-q")

class Target:
def __init__(self, **kw):
self.__dict__.update(kw)
# for the versioninfo resources
self.version = "1.5.0"
self.company_name = "DurumDara Ltd."
self.copyright = "Copyright by DurumDara 2006."
self.name = "wxPyHDDirList"

################################################################
# A program using wxPython

# The manifest will be inserted as resource into test_wx.exe. This
# gives the controls the Windows XP appearance (if run on XP ;-)
#
# Another option would be to store it in a file named
# test_wx.exe.manifest, and copy it with the data_files option into
# the dist-dir.
#

wxPyHDDirList = Target(
# used for the versioninfo resource
description = "wxPyHDDirList",

# what to build
script = "wxPyHDDirList.py",
icon_resources = [(1, "main.ico")],
dest_base = "wxPyHDDirList")

setup(
options = {"py2exe": {"bundle_files": 1,
"compressed": 1,
"optimize": 2}},
# The lib directory contains everything except the executables and
the python dll.
# Can include a subdirectory name.
windows = [wxPyHDDirList],
)

Ps2:
A BUG !

setup(
options = {"py2exe": {"bundle_files": 1,
"compressed": 3, # !
"optimize": 4}}, # !
# The lib directory contains everything except the executables and
the python dll.
# Can include a subdirectory name.
windows = [wxPyHDDirList],
)

These valus makes that compiled exe is cannot do encodings (example:
iso-8859-2).... :-(

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedFeb 27, '06 at 12:21p
activeFeb 27, '06 at 12:21p
posts1
users1
websitepython.org

1 user in discussion

Durumdara: 1 post

People

Translate

site design / logo © 2022 Grokbase