blob: 01f01bec11f46c12e895ee85f91e01f695f9f54b [file] [log] [blame]
Guido van Rossum3ff96dd1996-07-30 18:05:04 +00001This is Python release 1.4 beta 2
Guido van Rossumfaf681a1996-06-20 14:32:08 +00002=================================
3
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +00004It's a beta release. Use this only if you want to help me iron the
Guido van Rossumfaf681a1996-06-20 14:32:08 +00005last wrinkles out of the distribution before I release the real 1.4
6release. In particular, I'm interested in porting experiences to Unix
7boxes. It should build out of the box using "./configure; make".
8Also try running configue with the --with-thread and --with-readline
9options (described below).
Guido van Rossum627b2d71993-12-24 10:39:16 +000010
Guido van Rossum627b2d71993-12-24 10:39:16 +000011
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +000012What's new in this release?
13---------------------------
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000014
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +000015A list of things that changed since 1.4 beta 1 can be found in
16Misc/NEWS. This file will eventually be updated to also list what's
17new since to 1.3.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000018
19
Guido van Rossum91cb9d21995-04-10 11:47:38 +000020What is Python anyway?
21----------------------
22
23Python is an interpreted object-oriented programming language, and is
24often compared to Tcl, Perl or Scheme. For a quick summary of what
Guido van Rossumfaf681a1996-06-20 14:32:08 +000025Python can mean for a UNIX/C programmer, read Misc/BLURB.LUTZ. If you
26have web access, point your browser to <URL:http://www.python.org>.
Guido van Rossum91cb9d21995-04-10 11:47:38 +000027
28
29If you don't read instructions
30------------------------------
31
32Congratulations on getting this far. :-)
33
34To start building right away (on UNIX): type "./configure" in the
35current directory and when it finishes, type "make". The section
36Build Instructions below is still recommended reading. :-)
37
38
39Copyright issues
40----------------
41
42Python is COPYRIGHTED but free to use for all. See the full copyright
43notice at the end of this file.
44
45The Python distribution is *not* affected by the GNU Public Licence
46(GPL). There are interfaces to some GNU code but these are entirely
47optional and no GNU code is distributed with Python. For all these
48packages, GPL-free public domain versions also exist.
49
Guido van Rossum627b2d71993-12-24 10:39:16 +000050
Guido van Rossumff840491995-09-18 22:02:47 +000051A modest plug
52=============
53
54
Guido van Rossum0447a321995-10-08 01:22:33 +000055*************************************************************************
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000056* *
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +000057* If you use Python, please consider joining the Python Software *
58* Activity (PSA). See http://www.python.org/psa/. *
59* *
60* Organizations making heavy use of Python are especially invited *
61* to become corporate members! *
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000062* *
Guido van Rossum0447a321995-10-08 01:22:33 +000063*************************************************************************
Guido van Rossumff840491995-09-18 22:02:47 +000064
Guido van Rossum627b2d71993-12-24 10:39:16 +000065
Guido van Rossum433c8ad1994-08-01 12:07:07 +000066Build instructions
Guido van Rossum91cb9d21995-04-10 11:47:38 +000067==================
Guido van Rossum627b2d71993-12-24 10:39:16 +000068
Guido van Rossum433c8ad1994-08-01 12:07:07 +000069Before you start building Python, you must first configure it. This
70entails (at least) running the script "./configure", which figures out
Guido van Rossum91cb9d21995-04-10 11:47:38 +000071your system configuration and creates several Makefiles. (It takes a
72minute or two -- please be patient!) When it's done, you are ready to
73run make. Typing "make" in the toplevel directory will recursively
74run make in each of the subdirectories Parser, Objects, Python and
75Modules, creating a library file in each one. The executable of the
76interpreter is built in the Modules subdirectory and moved up here
77when it is built. If you want or need to, you can also chdir into
78each subdirectory in turn and run make there manually (do the Modules
79subdirectory last!).
Guido van Rossum627b2d71993-12-24 10:39:16 +000080
Guido van Rossum91cb9d21995-04-10 11:47:38 +000081NOTE: if you rerun the configure script with different options, remove
82all object files by running "make clean" before rebuilding. Believe
83it or not, "make clean" sometimes helps to clean up other inexplicable
84problems as well. Try it before sending in a bug report!
Guido van Rossum627b2d71993-12-24 10:39:16 +000085
Guido van Rossum0a516c91994-09-12 10:58:40 +000086
Guido van Rossum91cb9d21995-04-10 11:47:38 +000087Troubleshooting
88---------------
Guido van Rossum627b2d71993-12-24 10:39:16 +000089
Guido van Rossumfaf681a1996-06-20 14:32:08 +000090If recursive makes fail, try invoking make as "make MAKE=make".
91
92If you run into other trouble, see section 3 of the FAQ (file
93Misc/FAQ) for hints on what can go wrong, and how to fix it.
Guido van Rossum91cb9d21995-04-10 11:47:38 +000094
95
96Platform specific notes
97-----------------------
98
Guido van Rossum0447a321995-10-08 01:22:33 +000099(Some of these may no longer apply. If you find you can build Python
100on these platforms without the special directions mentioned here, let
101me know so I can remove them!)
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000102
Guido van Rossum8eca2c21996-02-14 18:37:46 +0000103Linux: Once you've built Python, use it to run the regen.py script in
104 the Lib/linux1 directory. Apparently the files as distributed
105 don't match the system headers on some Linux versions.
106
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000107AIX: Read the files Misc/AIX-NOTES* before trying to build.
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000108 WARNING! In some versions of AIX, you get errors about
109 Invalid Indent when running the Python test set. This appears
110 to be a bug in the AIX compiler. Rebuild Parser/tokenizer.c
111 using OPT="" or OPT=-g, or use gcc.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000112
113HP-UX: Read the file Misc/HPUX-NOTES if you want to be able to
114 use shared libraries for dynamically loaded modules.
115
116Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"!
117
118SCO: 1) Everything works much better if you add -U__STDC__ to the
119 defs. This is because all the SCO header files are broken.
120 Anything that isn't mentioned in the C standard it's
121 conditionally excluded when __STDC__ is defined.
122
123 2) Due to the U.S. export restrictions, SCO broke the crypt
124 stuff out into a separate library, libcrypt_i.a so the LIBS
125 needed be set to:
126
127 LIBS=' -lsocket -lcrypt_i'
128
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000129 3) According to at least one report, the above apply only to
130 SCO 3 -- Python builds out of the box on SCO 5.
131
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000132
133Configuring the set of built-in modules
134---------------------------------------
Guido van Rossum19e0c261995-01-17 16:36:34 +0000135
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000136You can configure the interpreter to contain fewer or more built-in
137modules by editing the file Modules/Setup. This file is initially
138copied (when the toplevel Makefile makes Modules/Makefile for the
139first time) from Setup.in; if it does not exist yet, make a copy
140yourself. Never edit Setup.in -- always edit Setup. Read the
141comments in the file for information on what kind of edits you can
142make. When you have edited Setup, Makefile and config.c in Modules
143will automatically be rebuilt the next time you run make in the
Guido van Rossum9444ce01994-10-20 22:10:23 +0000144toplevel directory.
Guido van Rossum627b2d71993-12-24 10:39:16 +0000145
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000146Especially on SGI IRIX, there are modules that interface to many SGI
147specific system libraries, e.g. the GL library and the audio hardware.
148
149
150Setting the optimization/debugging options
151------------------------------------------
152
153If you want to change the optimization/debugging options for the C
154compiler, assign to the OPT variable on the toplevel make command;
155e.g. "make OPT=-g" will build a debugging version of Python on most
156platforms. The default is OPT=-O; a value for OPT in the environment
157when the configure script is run overrides this default (likewise for
158CC; and the initial value for LIBS is used as the base set of
159libraries to link with).
160
161
162Testing
163-------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000164
165To test the interpreter that you have just built, type "make test".
166This runs the test set silently, twice (once with no compiled files,
167once with the compiled files left by the previous test run). Each
168test run should print "All tests OK." and nothing more. (The test set
169does not test the built-in modules, but will find most other problems
170with the interpreter.)
171
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000172IMPORTANT: If the tests fail and you decide to mail a bug report,
173*don't* include the output of "make test". It is useless. Run the
174following command instead:
175
176 PYTHONPATH=../Lib:../Lib/test:./Modules ./python -c 'import testall'
177
178(substituting the top of the source tree for .. if you built in a
179different directory). This gives the output of the tests and shows
180which test failed.
181
182
183Installing
184----------
185
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000186XXX TO be rewritten for new install procedure.
187
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000188To install the interpreter as /usr/local/bin/python, type "make
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000189bininstall". To install the library as /usr/local/lib/python, type
190"make libinstall". To install the manual page as
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000191/usr/local/man/man1/python.1, type "make maninstall". To install the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000192Emacs editing mode for Python, manually copy the file
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000193Misc/python-mode.el to your local Emacs lisp directory. The directory
194/usr/local can be overridden at configuration time by passing
195--prefix=DIRECTORY to the configure script, or at make time by passing
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000196"prefix=DIRECTORY" to make. See below for more information on
197--prefix.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000198
199If you plan to do development of extension modules or to embed Python
200in another application and don't want to reference the original source
201tree, you can type "make inclinstall" and "make libainstall" to
202install the include files and lib*.a files, respectively, as
203/usr/local/include/Py/*.h and /usr/local/lib/python/lib/lib*.a. The
204make libainstall target also installs copies of several other files
205used or produced during the build process which are needed to build
206extensions or to generate their Makefiles.
207
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000208
209Configuration options and variables
210-----------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000211
212Some special cases are handled by passing environment variables or
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000213options to the configure script.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000214
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000215NOTE: if you rerun the configure script with different options, remove
216all object files by running "make clean" before rebuilding.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000217
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000218--with(out)-gcc: The configure script uses gcc (the GNU C compiler) if
219 it finds it. If you don't want this, or if this compiler is
220 installed but broken on your platform, pass the option
221 --without-gcc. You can also pass "CC=cc" (or whatever the
222 name of the proper C compiler is) in the environment, but the
223 advantage of using --without-gcc is that this option is
224 remembered by the config.status script for its --recheck
225 option.
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000226
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000227--prefix, --exec-prefix: If you want to install the binaries and the
228 Python library somewhere else than in /usr/local/{bin,lib},
229 you can pass the option --prefix=DIRECTORY; the interpreter
230 binary will be installed as DIRECTORY/bin/python and the
231 library files as DIRECTORY/lib/python/*. If you pass
232 --exec-prefix=DIRECTORY (as well) this overrides the
233 installation prefix for architecture-dependent files (like the
234 interpreter binary). Note that --prefix=DIRECTORY also
235 affects the default module search path (sys.path), when
236 Modules/config.c is compiled. Passing make the option
237 prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the
238 prefix set at configuration time; this may be more convenient
239 than re-running the configure script if you change your mind
240 about the install prefix...
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000241
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000242--with-readline: You can use the GNU readline library to improve the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000243 interactive user interface. This gives you line editing and
244 command history when calling Python interactively. Unless GNU
245 readline is a standard part of your system (it is on Linux),
246 you need to configure build the GNU readline library before
247 running the configure script. Its sources are not distributed
248 with Python; you can ftp them from any GNU mirror site, or
249 from its home site:
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000250 <URL:ftp://slc2.ins.cwru.edu/pub/dist/readline-2.0.tar.gz> (or
251 a higher version number -- using version 1.x is not
252 recommended).
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000253
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000254 A GPL-free version was posted to comp.sources.misc in volume
255 31 and is widely available from FTP archive sites, e.g.
256 <URL:ftp://gatekeeper.dec.com/.b/usenet/comp.sources.misc/
257 volume31/editline/part01.Z>
258
259 Pass the Python configure script the option
260 --with-readline=DIRECTORY where DIRECTORY is the absolute
261 pathname of the directory where you've built the readline
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000262 library. If GNU readline is a standard part of your system,
263 don't pass '=DIRECTORY'. Some hints on building and using the
264 readline library are in the FAQ (file Misc/FAQ).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000265
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000266--with-thread: On most Unix systems, you can now use multiple threads.
267 To enable this, pass --with-thread. If the library required
268 for threads lives in a peculiar place, you can use
269 --with-thread=DIRECTORY. In the Modules/Setup file, enable
270 the thread module. (Threads aren't enabled automatically
271 because there are run-time penalties when support for them is
272 compiled in even if you don't use them.)
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000273
274--with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is
275 supported by the "dl" library by Jack Jansen, which is
276 ftp'able from <URL:ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z>.
277 This is enabled (after you've ftp'ed and compiled the dl
278 library!) by passing --with-sgi-dl=DIRECTORY where DIRECTORY
279 is the absolute pathname of the dl library. (Don't bother on
280 IRIX 5, it already has dynamic linking using SunOS style
281 shared libraries.) Support for this feature is deprecated.
282
283--with-dl-dld: Dynamic loading of modules is rumoured to be supported
284 on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent
285 Symmetry (Dynix), and Atari ST. This is done using a
286 combination of the GNU dynamic loading package
287 (<URL:ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z>) and an
288 emulation of the SGI dl library mentioned above (the emulation
289 can be found at
290 <URL:ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z>). To
291 enable this, ftp and compile both libraries, then call the
292 configure passing it the option
293 --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is
294 the absolute pathname of the dl emulation library and
295 DLD_DIRECTORY is the absolute pathname of the GNU dld library.
296 (Don't bother on SunOS 4 or 5, they already have dynamic
297 linking using shared libraries.) Support for this feature is
298 deprecated.
299
300--with-libm, --with-libc: It is possible to specify alternative
301 versions for the Math library (default -lm) and the C library
302 (default the empty string) using the options
303 --with-libm=STRING and --with-libc=STRING, respectively. E.g.
304 if your system requires that you pass -lc_s to the C compiler
305 to use the shared C library, you can pass --with-libc=-lc_s.
306 These libraries are passed after all other libraries, the C
307 library last.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +0000308
309--with-next-archs='arch1 arch2': Under NEXTSTEP, this will build
310 all compiled binaries with the architectures listed. Includes
311 correctly setting the target architecture specific resource
312 directory.
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000313
314
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000315Building for multiple architectures (using the VPATH feature)
316-------------------------------------------------------------
317
318If your file system is shared between multiple architectures, it
319usually is not necessary to make copies of the sources for each
320architecture you want to support. If the make program supports the
321VPATH feature, you can create an empty build directory for each
322architecture, and in each directory run the configure script (on the
323appropriate machine with the appropriate options). This creates the
324necessary subdirectories and the Makefiles therein. The Makefiles
325contain a line VPATH=... which points to directory containing the
Guido van Rossum6b111b01994-10-11 15:03:34 +0000326actual sources. (On SGI systems, use "smake" instead of "make" if you
327use VPATH -- don't try gnumake.)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000328
329For example, the following is all you need to build a minimal Python
330in /usr/tmp/python (assuming ~guido/src/python is the toplevel
331directory and you want to build in /usr/tmp/python):
332
333 $ mkdir /usr/tmp/python
334 $ cd /usr/tmp/python
335 $ ~guido/src/python/configure
336 [...]
337 $ make
338 [...]
339 $
340
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000341Note that Modules/Makefile copies the original Setup file to the build
342directory if it finds no Setup file there. This means that you can
343edit the Setup file for each architecture independently. For this
344reason, subsequent changes to the original Setup file are not tracked
345automatically, as they might overwrite local changes. To force a copy
346of a changed original Setup file, delete the target Setup file. (The
347makesetup script supports multiple input files, so if you want to be
348fancy you can change the rules to create an empty Setup.local if it
349doesn't exist and run it with arguments $(srcdir)/Setup Setup.local;
350however this assumes that you only need to add modules.)
351
352
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000353Building on non-UNIX systems
354----------------------------
355
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000356XXX Rewrite -- nothing in this chapter is true any more.
357
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000358On non-UNIX systems, you will have to fake the effect of running the
359configure script manually. A good start is to copy the file
360config.h.in to config.h and edit the latter to reflect the actual
361configuration of your system. Most symbols must simply be defined as
3621 only if the corresponding feature is present and can be left alone
363otherwise; however RETSIGTYPE must always be defined, either as int or
364as void, and the *_t type symbols must be defined as some variant of
365int if they need to be defined at all. Then arrange that the symbol
366HAVE_CONFIG_H is defined during compilation (usually by passing an
367argument of the form `-DHAVE_CONFIG_H' to the compiler, but this is
368necessarily system-dependent).
369
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000370I have tried to collect instructions, Makefiles and additional sources
371for various platforms in this release. The following directories
372exist:
373
374Mac/ Apple Macintosh, using THINK C 6.0 or MPW 3.2.
375Dos/ MS-DOS and Windows 3.1, using Microsoft C.
376Nt/ Windows NT, using Microsoft Visual C/C++.
377Os2/ OS/2.
378
379Most of these instructions were last tested with a previous Python
380release, so you may still experience occasional problems. If you have
381fixes or suggestions, please let me know and I'll try to incorporate
382them in the next release.
383
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000384
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000385
386Miscellaneous issues
387====================
388
389
390Documentation
391-------------
392
393All documentation is provided in the subdirectory Doc in the form of
394LaTeX files. In order of importance for new users: Tutorial (tut),
395Library Reference (lib), Language Reference (ref), Extending (ext).
396Especially the Library Reference is of immense value since much of
397Python's power (including the built-in data types and functions!) is
398described here.
399
400To print the documentation from the LaTeX files, chdir into the Doc
401subdirectory, type "make" (let's hope you have LaTeX installed!), and
402send the four resulting PostScript files (tut.ps, lib.ps, ref.ps, and
403ext.ps) to the printer. See the README file there.
404
405All documentation is also available on-line via the World-Wide Web
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000406(WWW): <URL:http://www.python.org>. It can also be downloaded
407separately from the ftp archives (see below) in Emacs INFO, HTML or
408PostScript form -- see the FAQ (file Misc/FAQ) for more info.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000409
410
411Emacs mode
412----------
413
414There's an excellent Emacs editing mode for Python code; see the file
415Misc/python-mode.el. Originally written by Tim Peters, who's no
416longer on the net, it is now maintained by Barry Warsaw
417<bwarsaw@cnri.reston.va.com>.
418
Guido van Rossum3c294ca1995-06-14 18:17:22 +0000419BTW, if you want to use font-lock for Python sources, here's something
420to put in your .emacs file:
421
422 (defun my-python-mode-hook ()
423 (setq font-lock-keywords python-font-lock-keywords)
424 (font-lock-mode 1))
425 (add-hook 'python-mode-hook 'my-python-mode-hook)
426
427
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000428
429Bug reports
430-----------
431
432Bugs are best reported to the comp.lang.python newsgroup or the Python
433mailing list -- see the section "Newsgroup and mailing list" below.
434Before posting, read the FAQ (file Misc/FAQ) first to see if your
435problem has already been answered!
436
437
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000438Web site
439--------
440
441Python's own web site has URL http://www.python.org/. Come visit us!
442
443
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000444Ftp access
445----------
446
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000447Python's own ftp site is ftp.python.org, directory /pub/python. See
448the FAQ (file Misc/FAQ) for a list of other ftp sites carrying the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000449Python distribution.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000450
451
452Newsgroup and mailing list
453--------------------------
454
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000455There are a newsgroup and a mailing list devoted to Python. The
456newsgroup, comp.lang.python, contains exactly the same messages as the
457mailing list (though not always in the same order, due to the
458mysterious nature of Usenet news' flooding algorithms). To subscribe
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000459to the mailing list, send mail containing your real name and e-mail
460address to "python-list-request@cwi.nl" (a real person reads these
461messages, so no LISTPROC or Majordomo commands, please).
462
463
464The Tk interface
465----------------
466
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000467XXX To be rewritten in the light of _tkinter and Tk 4.1.
468
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000469Tk (the user interface component of John Ousterhout's Tcl language) is
470also usable from Python. Since this requires that you first build and
471install Tcl/Tk, the Tk interface is not enabled by default. It
Guido van Rossum84c8c7f1995-08-28 02:44:24 +0000472requires Tcl 7.4 and Tk 4.0. (Support for Tk 3.6 and Tcl 7.3 can be
473found in Lib/tk3inter/.)
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000474
475To enable the Python/Tk interface, once you've built and installed
476Tcl/Tk, all you need to do is edit two lines in Modules/Setup; search
Jack Jansen10d0f8f1995-10-23 14:36:05 +0000477for the string "_tkinter". Un-comment one (normally the first) of the
478lines beginning with "#_tkinter" and un-comment the line beginning with
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000479"#TKPATH". (If you have installed Tcl/Tk in unusual places you will
480have to edit the first line as well to fix the -I and -L options.)
481See the Build Instructions above for more details.
482
483There is little documentation. Begin with fetching the "Tk Lifesaver"
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000484document,
485e.g. <URL:ftp://ftp.python.org/pub/python/doc/tkinter-doc.tar.gz> (a
486gzipped tar file containing a PostScript file). There are demos in
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000487the Demo/tkinter directory, in the subdirectories guido, matt and www.
488
489Note that there's a Python module called "Tkinter" (capital T) which
490lives in Lib/tkinter/Tkinter.py, and a C module called "tkinter"
Jack Jansen10d0f8f1995-10-23 14:36:05 +0000491(lower case t) which lives in Modules/_tkinter.c. Demos and
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000492normal Tk applications only import the Python Tkinter module -- only
Jack Jansen10d0f8f1995-10-23 14:36:05 +0000493the latter uses the C _tkinter module directly. In order to find the C
494_tkinter module, it must be compiled and linked into the Python
495interpreter -- the _tkinter line in the Setup file does this. In order
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000496to find the Python Tkinter module, sys.path must be set correctly --
497the TKPATH assignment in the Setup file takes care of this, but only
498if you install Python properly ("make install libinstall"). (You can
Jack Jansen10d0f8f1995-10-23 14:36:05 +0000499also use dynamic loading for the C _tkinter module, in which case you
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000500must manually fix up sys.path or set $PYTHONPATH for the Python
501Tkinter module.)
502
Guido van Rossum0447a321995-10-08 01:22:33 +0000503See <URL:http://www.smli.com/research/tcl/> for more info on where
Guido van Rossum84c8c7f1995-08-28 02:44:24 +0000504to get Tcl/Tk.
505
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000506
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000507Distribution structure
508----------------------
509
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000510XXX To be redone!
511
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000512Most subdirectories have their own README file. Most files have
513comments.
514
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000515Demo/ Demonstration scripts, modules and programs
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000516Doc/ Documentation (LaTeX sources)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000517Grammar/ Input for the parser generator
518Include/ Public header files
519Lib/ Python library modules
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000520Makefile.in Source from which config.status creates Makefile
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000521Misc/ Miscellaneous files
522Modules/ Implementation of most built-in modules
523Objects/ Implementation of most built-in object types
524Parser/ The parser and tokenizer and their input handling
525Python/ The "compiler" and interpreter
526README The file you're reading now
Guido van Rossume109aa71995-03-09 14:12:10 +0000527Tools/ Some useful programs written in Python
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000528acconfig.h Additional input for the autoheader program
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000529config.h.in Source from which config.status creates config.h
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000530configure Configuration shell script (GNU autoconf output)
531configure.in Configuration specification (GNU autoconf input)
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000532
533The following files will (may) be created in the toplevel directory by
534the configuration and build processes:
535
536Makefile Build rules
537config.cache cache of configuration variables
538config.h Configuration header
539config.log log from last configure run
540config.status status from last run of configure script
541python The executable interpreter
542tags, TAGS Tags files for vi and Emacs
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000543
544
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000545Author's address
546----------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000547
548Guido van Rossum
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000549CNRI
5501895 Preston White Drive
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000551Reston, VA 20191
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000552USA
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000553
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000554E-mail: guido@cnri.reston.va.or or guido@python.org
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000555
556
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000557
558Copyright notice
559================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000560
561The Python source is copyrighted, but you can freely use and copy it
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000562as long as you don't change or remove the copyright notice:
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000563
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000564----------------------------------------------------------------------
Guido van Rossumaf5b83e1995-01-04 19:02:35 +0000565Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
566The Netherlands.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000567
568 All Rights Reserved
569
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000570Permission to use, copy, modify, and distribute this software and its
571documentation for any purpose and without fee is hereby granted,
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000572provided that the above copyright notice appear in all copies and that
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000573both that copyright notice and this permission notice appear in
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000574supporting documentation, and that the names of Stichting Mathematisch
575Centrum or CWI not be used in advertising or publicity pertaining to
576distribution of the software without specific, written prior permission.
577
578STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
579THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
580FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
581FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
582WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
583ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
584OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000585----------------------------------------------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000586
587
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000588--Guido van Rossum (home page: http://www.python.org/~guido/)