Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(11)

Delta Between Two Patch Sets: Tools/freeze/README

Issue 15550: Trailing white spaces
Left Patch Set: Created 7 years, 8 months ago
Right Patch Set: Created 7 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « Tools/freeze/extensions_win32.ini ('k') | Tools/msi/README.txt » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 THE FREEZE SCRIPT 1 THE FREEZE SCRIPT
2 ================= 2 =================
3 3
4 (Directions for Windows are at the end of this file.) 4 (Directions for Windows are at the end of this file.)
5 5
6 6
7 What is Freeze? 7 What is Freeze?
8 --------------- 8 ---------------
9 9
10 Freeze make it possible to ship arbitrary Python programs to people 10 Freeze make it possible to ship arbitrary Python programs to people
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 Freezing Tkinter programs 93 Freezing Tkinter programs
94 ------------------------- 94 -------------------------
95 95
96 Unfortunately, it is currently not possible to freeze programs that 96 Unfortunately, it is currently not possible to freeze programs that
97 use Tkinter without a Tcl/Tk installation. The best way to ship a 97 use Tkinter without a Tcl/Tk installation. The best way to ship a
98 frozen Tkinter program is to decide in advance where you are going 98 frozen Tkinter program is to decide in advance where you are going
99 to place the Tcl and Tk library files in the distributed setup, and 99 to place the Tcl and Tk library files in the distributed setup, and
100 then declare these directories in your frozen Python program using 100 then declare these directories in your frozen Python program using
101 the TCL_LIBRARY, TK_LIBRARY and TIX_LIBRARY environment variables. 101 the TCL_LIBRARY, TK_LIBRARY and TIX_LIBRARY environment variables.
102 102
103 For example, assume you will ship your frozen program in the directory 103 For example, assume you will ship your frozen program in the directory
104 <root>/bin/windows-x86 and will place your Tcl library files 104 <root>/bin/windows-x86 and will place your Tcl library files
105 in <root>/lib/tcl8.2 and your Tk library files in <root>/lib/tk8.2. Then 105 in <root>/lib/tcl8.2 and your Tk library files in <root>/lib/tk8.2. Then
106 placing the following lines in your frozen Python script before importing 106 placing the following lines in your frozen Python script before importing
107 Tkinter or Tix would set the environment correctly for Tcl/Tk/Tix: 107 Tkinter or Tix would set the environment correctly for Tcl/Tk/Tix:
108 108
109 import os 109 import os
110 import os.path 110 import os.path
111 RootDir = os.path.dirname(os.path.dirname(os.getcwd())) 111 RootDir = os.path.dirname(os.path.dirname(os.getcwd()))
112 112
113 import sys 113 import sys
114 if sys.platform == "win32": 114 if sys.platform == "win32":
(...skipping 16 matching lines...) Expand all
131 for any Python files such as _tkinter.pyd you may need. 131 for any Python files such as _tkinter.pyd you may need.
132 132
133 Note that the dynamic libraries (such as tcl82.dll tk82.dll python20.dll 133 Note that the dynamic libraries (such as tcl82.dll tk82.dll python20.dll
134 under Windows, or libtcl8.2.so and libtcl8.2.so under Unix) are required 134 under Windows, or libtcl8.2.so and libtcl8.2.so under Unix) are required
135 at program load time, and are searched by the operating system loader 135 at program load time, and are searched by the operating system loader
136 before Python can be started. Under Windows, the environment 136 before Python can be started. Under Windows, the environment
137 variable PATH is consulted, and under Unix, it may be the 137 variable PATH is consulted, and under Unix, it may be the
138 environment variable LD_LIBRARY_PATH and/or the system 138 environment variable LD_LIBRARY_PATH and/or the system
139 shared library cache (ld.so). An additional preferred directory for 139 shared library cache (ld.so). An additional preferred directory for
140 finding the dynamic libraries is built into the .dll or .so files at 140 finding the dynamic libraries is built into the .dll or .so files at
141 compile time - see the LIB_RUNTIME_DIR variable in the Tcl makefile. 141 compile time - see the LIB_RUNTIME_DIR variable in the Tcl makefile.
142 The OS must find the dynamic libraries or your frozen program won't start. 142 The OS must find the dynamic libraries or your frozen program won't start.
143 Usually I make sure that the .so or .dll files are in the same directory 143 Usually I make sure that the .so or .dll files are in the same directory
144 as the executable, but this may not be foolproof. 144 as the executable, but this may not be foolproof.
145 145
146 A workaround to installing your Tcl library files with your frozen 146 A workaround to installing your Tcl library files with your frozen
147 executable would be possible, in which the Tcl/Tk library files are 147 executable would be possible, in which the Tcl/Tk library files are
148 incorporated in a frozen Python module as string literals and written 148 incorporated in a frozen Python module as string literals and written
149 to a temporary location when the program runs; this is currently left 149 to a temporary location when the program runs; this is currently left
150 as an exercise for the reader. An easier approach is to freeze the 150 as an exercise for the reader. An easier approach is to freeze the
151 Tcl/Tk/Tix code into the dynamic libraries using the Tcl ET code, 151 Tcl/Tk/Tix code into the dynamic libraries using the Tcl ET code,
152 or the Tix Stand-Alone-Module code. Of course, you can also simply 152 or the Tix Stand-Alone-Module code. Of course, you can also simply
153 require that Tcl/Tk is required on the target installation, but be 153 require that Tcl/Tk is required on the target installation, but be
154 careful that the version corresponds. 154 careful that the version corresponds.
155 155
156 There are some caveats using frozen Tkinter applications: 156 There are some caveats using frozen Tkinter applications:
157 Under Windows if you use the -s windows option, writing 157 Under Windows if you use the -s windows option, writing
158 to stdout or stderr is an error. 158 to stdout or stderr is an error.
159 The Tcl [info nameofexecutable] will be set to where the 159 The Tcl [info nameofexecutable] will be set to where the
160 program was frozen, not where it is run from. 160 program was frozen, not where it is run from.
161 The global variables argc and argv do not exist. 161 The global variables argc and argv do not exist.
162 162
163 163
164 A warning about shared library modules 164 A warning about shared library modules
165 -------------------------------------- 165 --------------------------------------
166 166
167 When your Python installation uses shared library modules such as 167 When your Python installation uses shared library modules such as
168 _tkinter.pyd, these will not be incorporated in the frozen program. 168 _tkinter.pyd, these will not be incorporated in the frozen program.
169 Again, the frozen program will work when you test it, but it won't 169 Again, the frozen program will work when you test it, but it won't
170 work when you ship it to a site without a Python installation. 170 work when you ship it to a site without a Python installation.
171 171
172 Freeze prints a warning when this is the case at the end of the 172 Freeze prints a warning when this is the case at the end of the
173 freezing process: 173 freezing process:
174 174
175 Warning: unknown modules remain: ... 175 Warning: unknown modules remain: ...
176 176
177 When this occurs, the best thing to do is usually to rebuild Python 177 When this occurs, the best thing to do is usually to rebuild Python
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 -h: Print this help message. 268 -h: Print this help message.
269 269
270 -x module Exclude the specified module. 270 -x module Exclude the specified module.
271 271
272 -i filename: Include a file with additional command line options. Used 272 -i filename: Include a file with additional command line options. Used
273 to prevent command lines growing beyond the capabilities of 273 to prevent command lines growing beyond the capabilities of
274 the shell/OS. All arguments specified in filename 274 the shell/OS. All arguments specified in filename
275 are read and the -i option replaced with the parsed 275 are read and the -i option replaced with the parsed
276 params (note - quoting args in this file is NOT supported) 276 params (note - quoting args in this file is NOT supported)
277 277
278 -s subsystem: Specify the subsystem (For Windows only.); 278 -s subsystem: Specify the subsystem (For Windows only.);
279 'console' (default), 'windows', 'service' or 'com_dll' 279 'console' (default), 'windows', 'service' or 'com_dll'
280 280
281 -w: Toggle Windows (NT or 95) behavior. 281 -w: Toggle Windows (NT or 95) behavior.
282 (For debugging only -- on a win32 platform, win32 behavior 282 (For debugging only -- on a win32 platform, win32 behavior
283 is automatic.) 283 is automatic.)
284 284
285 Arguments: 285 Arguments:
286 286
287 script: The Python script to be executed by the resulting binary. 287 script: The Python script to be executed by the resulting binary.
288 288
289 module ...: Additional Python modules (referenced by pathname) 289 module ...: Additional Python modules (referenced by pathname)
290 that will be included in the resulting binary. These 290 that will be included in the resulting binary. These
291 may be .py or .pyc files. If -m is specified, these are 291 may be .py or .pyc files. If -m is specified, these are
292 module names that are search in the path instead. 292 module names that are search in the path instead.
293 293
294 294
295 295
296 --Guido van Rossum (home page: http://www.python.org/~guido/) 296 --Guido van Rossum (home page: http://www.python.org/~guido/)
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+