Simon has added some docs for building textRouter with py2exe. These
instructions are applicable to other PythonCard samples, so if you want to
build a standalone Windows EXE for any sample, then the setup.py file and
instructions below should be helpful. Most samples don't have an icon so
that option can be omitted. The data_files section should be changed to
include any resource files, readme.txt or data files needed by the sample.
The --excludes=Image option is to keep the Python Imaging Library (PIL) from
being included, which also prevents Tkinter from being included. None of the
samples use the PIL conversion routines, but if you needed them a different
command-line would be necessary. Thomas sent me some email about this issue,
but I haven't done any experimentation to find the right combination of
imports and excludes to exclude Tkinter, but include the parts of PIL needed
for conversions.
See http://py2exe.sourceforge.net/ for a complete list of options.
ka
---
how_to_build.txt:
Building a Windows EXE using 'py2exe'.
All you have to do, once everything is installed, is just type:
c:\path\to\tr> python setup.py py2exe -w --icon tr.ico --excludes=Image -O1
in the PythonCardPrototype/samples/textRouter directory.
setup.py:
from distutils.core import setup
import py2exe
setup( name = "textRouter",
scripts = ["textRouter.py"],
data_files = [ ("docs",
["docs/textRouter_help.html", "docs/readme.html"]),
(".",
["strings.txt", "readme.txt", "textRouter.rsrc.py",
"tr.ico"])
]
)
|