blob: 61664d5c76edd5e8a32bac8f78249a57f27a5f41 [file] [log] [blame]
Guido van Rossumf501b4e1996-10-25 14:32:48 +00001This is Python release 1.4 (final)
2==================================
Guido van Rossumfaf681a1996-06-20 14:32:08 +00003
Guido van Rossumf501b4e1996-10-25 14:32:48 +00004I appreciate everybody's patience... This is the official, final
5release of Python 1.4. You can throw away your copies of 1.3 and the
61.4 betas now!
Guido van Rossum627b2d71993-12-24 10:39:16 +00007
Guido van Rossum627b2d71993-12-24 10:39:16 +00008
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +00009What's new in this release?
10---------------------------
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000011
Guido van Rossumf501b4e1996-10-25 14:32:48 +000012An exhaustive list of (nearly) everything that changed since the
13release of Python 1.3, over a year ago, can be found in the file
14Misc/NEWS. (A history of all changes before that time is kept in
15Misc/HISTORY.) An overview of the most important user-visible changes
16is appended as a new chapter to the Tutorial (Doc/tut.tex). Perhaps
17the most visible changes are the new power operator, complex numbers,
18new slicing and indexing syntax, and class-private names of the form
19__spam (an experimental feature).
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000020
21
Guido van Rossum91cb9d21995-04-10 11:47:38 +000022What is Python anyway?
23----------------------
24
25Python is an interpreted object-oriented programming language, and is
Guido van Rossum6d9cc801996-08-01 17:31:22 +000026often compared to Tcl, Perl, Scheme or Java. For a quick summary of
27what Python can mean for a UNIX/C programmer, read Misc/BLURB.LUTZ.
Guido van Rossumdfcf35d1996-08-26 17:52:09 +000028If you have web access, point your browser to http://www.python.org.
Guido van Rossum91cb9d21995-04-10 11:47:38 +000029
30
Guido van Rossumf501b4e1996-10-25 14:32:48 +000031How do I learn Python?
32----------------------
33
34The official tutorial is still a good place to start (in the Doc
35directory as tut.tex; and http://www.python.org/doc/tut/tut.html).
36Aaron Watters wrote a second tutorial, that may be more accessible for
37some: http://www.wcmh.com/uworld/archives/95/tutorial/005.html.
38
39There are now also two books on Python. While these are still based
40on Python 1.3 or 1.4beta2, the language is so stable now that you'd be
41hard pressed to find places where the books are out of date. The
42books, both first published in October 1996 and both including a
43CD-ROM, form excellent companions to each other:
44
45 Internet Programming with Python
46 by Aaron Watters, Guido van Rossum, and James Ahlstrom
47 MIS Press/Henry Holt publishers
48 ISBN: 1-55851-484-8
49
50 Programming Python
51 by Mark Lutz
52 O'Reilly & Associates
53 ISBN: 1-56592-197-6
54
55
Guido van Rossum91cb9d21995-04-10 11:47:38 +000056If you don't read instructions
57------------------------------
58
59Congratulations on getting this far. :-)
60
61To start building right away (on UNIX): type "./configure" in the
62current directory and when it finishes, type "make". The section
63Build Instructions below is still recommended reading. :-)
64
65
66Copyright issues
67----------------
68
69Python is COPYRIGHTED but free to use for all. See the full copyright
70notice at the end of this file.
71
72The Python distribution is *not* affected by the GNU Public Licence
73(GPL). There are interfaces to some GNU code but these are entirely
74optional and no GNU code is distributed with Python. For all these
75packages, GPL-free public domain versions also exist.
76
Guido van Rossum627b2d71993-12-24 10:39:16 +000077
Guido van Rossum6d9cc801996-08-01 17:31:22 +000078
Guido van Rossumff840491995-09-18 22:02:47 +000079A modest plug
80=============
81
Guido van Rossumf501b4e1996-10-25 14:32:48 +000082*********************************************************************
83* Without your help, I won't be able to continue to support Python! *
84*********************************************************************
Guido van Rossumff840491995-09-18 22:02:47 +000085
Guido van Rossumf501b4e1996-10-25 14:32:48 +000086If you use Python, please consider joining the Python Software
87Activity (PSA). See http://www.python.org/psa/.
88
89Organizations that make heavy use of Python are especially encouraged
90to become corporate members!
Guido van Rossum627b2d71993-12-24 10:39:16 +000091
Guido van Rossum6d9cc801996-08-01 17:31:22 +000092
Guido van Rossum433c8ad1994-08-01 12:07:07 +000093Build instructions
Guido van Rossum91cb9d21995-04-10 11:47:38 +000094==================
Guido van Rossum627b2d71993-12-24 10:39:16 +000095
Guido van Rossum6d9cc801996-08-01 17:31:22 +000096Before you can build Python, you must first configure it.
97Fortunately, the configuration and build process has been streamlined
98for most Unix installations, so all you have to do is type a few
99commands, optionally edit one file, and sit back. There are some
100platforms where things are not quite as smooth; see the platform
101specific notes below. If you want to build for multiple platforms
102sharing the same source tree, see the section on VPATH below.
Guido van Rossum627b2d71993-12-24 10:39:16 +0000103
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000104You start by running the script "./configure", which figures out your
105system configuration and creates several Makefiles. (It takes a
106minute or two -- please be patient!) When it's done, you are ready to
107run make. You may want to pass options to the configure script -- see
108the section below on configuration options and variables.
109
110To build Python, you normally type "make" in the toplevel directory.
111This will recursively run make in each of the subdirectories Parser,
112Objects, Python and Modules, creating a library file in each one. The
113executable of the interpreter is built in the Modules subdirectory and
114moved up here when it is built. If you want or need to, you can also
115chdir into each subdirectory in turn and run make there manually (do
116the Modules subdirectory last!).
117
118Once you have built an interpreter, see the subsections below on
119testing, configuring additional modules, and installation. If you run
120in trouble, see the next section.
Guido van Rossum627b2d71993-12-24 10:39:16 +0000121
Guido van Rossum0a516c91994-09-12 10:58:40 +0000122
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000123Troubleshooting
124---------------
Guido van Rossum627b2d71993-12-24 10:39:16 +0000125
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000126See also the platform specific notes in the next section.
127
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000128If recursive makes fail, try invoking make as "make MAKE=make".
129
130If you run into other trouble, see section 3 of the FAQ (file
131Misc/FAQ) for hints on what can go wrong, and how to fix it.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000132
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000133If you rerun the configure script with different options, remove all
134object files by running "make clean" before rebuilding. Believe it or
135not, "make clean" sometimes helps to clean up other inexplicable
136problems as well. Try it before sending in a bug report!
137
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000138If the configure script fails or doesn't seem to find things that
139should be there, inspect the config.log file.
140
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000141
142Platform specific notes
143-----------------------
144
Guido van Rossum0447a321995-10-08 01:22:33 +0000145(Some of these may no longer apply. If you find you can build Python
146on these platforms without the special directions mentioned here, let
147me know so I can remove them!)
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000148
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000149Linux: On Linux version 1.x, once you've built Python, use it to run
150 the regen script in the Lib/linux1 directory. Apparently
151 the files as distributed don't match the system headers on
152 some Linux versions. (The "h2py" command refers to
153 Tools/scripts/h2py.py.) The modules distributed for Linux 2.x
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000154 should be okay. Shared library support now works by default
155 on ELF-based x86 Linux systems.
Guido van Rossum8eca2c21996-02-14 18:37:46 +0000156
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000157AIX: A complete overhaul of the shared library support is now in
158 place. To enable it, uncomment the LINKCC line in the Setup
159 file. See Misc/AIX-NOTES for some notes on how it's done.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000160
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000161 WARNING! In some versions of AIX 3.x, you get errors about
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000162 Invalid Indent when running the Python test set. This appears
163 to be a bug in the AIX compiler. Rebuild Parser/tokenizer.c
164 using OPT="" or OPT=-g, or use gcc.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000165
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000166HP-UX: Shared library support now works by default (at least on HP-UX
167 9.x). One other problem remains: the HP ANSI C compiler (cc
168 -Aa) is too pedantic to use, but in K&R mode, it barfs on a
169 few files (complexobject.c, getargs.c and operator.c). Until
170 this is fixed, the following seems to work:
171
172 make -k # this compiles all but a few files
173 make OPT=-Aa # compile the remaining files
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000174
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000175Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"!
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000176
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000177SCO: 1) Everything works much better if you add -U__STDC__ to the
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000178 defs. This is because all the SCO header files are broken.
179 Anything that isn't mentioned in the C standard it's
180 conditionally excluded when __STDC__ is defined.
181
182 2) Due to the U.S. export restrictions, SCO broke the crypt
183 stuff out into a separate library, libcrypt_i.a so the LIBS
184 needed be set to:
185
186 LIBS=' -lsocket -lcrypt_i'
187
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000188 3) According to at least one report, the above apply only to
189 SCO 3 -- Python builds out of the box on SCO 5.
190
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000191SunOS: On SunOS 4.x, when using the native "cc" compiler, you have to
192 disable modules "cmath" and "operator" in Modules/Setup (see
193 the next section) and edit the various Makefiles to add
194 "-DWITHOUT_COMPLEX" to the CFLAGS variable, in order to
195 overcome the limitation to pre-ANSI C. (Or, of course, you
196 could get gcc :-).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000197
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000198NeXT: To build fat binaries, use the --with-next-archs switch
199 described below.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000200
201
202Configuring additional built-in modules
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000203---------------------------------------
Guido van Rossum19e0c261995-01-17 16:36:34 +0000204
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000205You can configure the interpreter to contain fewer or more built-in
206modules by editing the file Modules/Setup. This file is initially
207copied (when the toplevel Makefile makes Modules/Makefile for the
208first time) from Setup.in; if it does not exist yet, make a copy
209yourself. Never edit Setup.in -- always edit Setup. Read the
210comments in the file for information on what kind of edits you can
211make. When you have edited Setup, Makefile and config.c in Modules
212will automatically be rebuilt the next time you run make in the
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000213toplevel directory. (When working inside the Modules directory, use
214"make Makefile; make".)
Guido van Rossum627b2d71993-12-24 10:39:16 +0000215
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000216The default collection of modules should build on any Unix system, but
217many optional modules should work on all modern Unices (e.g. try dbm,
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000218nis, termios, timing, syslog, curses, new, soundex, parser). Often
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000219the quickest way to determine whether a particular module works or not
220is to see if it will build: enable it in Setup, then if you get
221compilation or link errors, disable it -- you're missing support.
222
223On SGI IRIX, there are modules that interface to many SGI specific
224system libraries, e.g. the GL library and the audio hardware.
225
226For SunOS and Solaris, enable module "sunaudiodev" to support the
227audio device.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000228
229
230Setting the optimization/debugging options
231------------------------------------------
232
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000233If you want or need to change the optimization/debugging options for
234the C compiler, assign to the OPT variable on the toplevel make
235command; e.g. "make OPT=-g" will build a debugging version of Python
236on most platforms. The default is OPT=-O; a value for OPT in the
237environment when the configure script is run overrides this default
238(likewise for CC; and the initial value for LIBS is used as the base
239set of libraries to link with).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000240
241
242Testing
243-------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000244
245To test the interpreter that you have just built, type "make test".
246This runs the test set silently, twice (once with no compiled files,
247once with the compiled files left by the previous test run). Each
248test run should print "All tests OK." and nothing more. (The test set
249does not test the built-in modules, but will find most other problems
250with the interpreter.)
251
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000252IMPORTANT: If the tests fail and you decide to mail a bug report,
253*don't* include the output of "make test". It is useless. Run the
254following command instead:
255
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000256 PYTHONPATH=../Lib:../Lib/test:./Modules ./python -c 'import testall'
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000257
258(substituting the top of the source tree for .. if you built in a
259different directory). This gives the output of the tests and shows
260which test failed.
261
262
263Installing
264----------
265
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000266Installing Python was never this easy!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000267
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000268To install the Python binary, library modules, shared library modules
269(see below), include files, configuration files, and the manual page,
270just type "make install". This will install all platform-independent
271files in subdirectories the directory given with the --prefix option
272to configure or the 'prefix' Make variable (default /usr/local), and
273all binary and other platform-specific files in subdirectories if the
274directory given by --exec-prefix or the 'exec_prefix' Make variable
275(defaults to the --prefix directory). All subdirectories created will
276have Python's version number in their name, e.g. the library modules
277are installed in "/usr/local/lib/python1.4/" by default. The Python
278binary is installed as "python1.4" and a hard link named "python" is
279created. The only file not installed with a version number in its
280name is the manual page, installed as "/usr/local/man/man1/python.1"
281by default.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000282
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000283If you have a previous installation of a pre-1.4 Python that you don't
284want to replace yet, use "make altinstall". This installs the same
285set of files as "make install" except it doesn't create the hard link
286to "python1.4" named "python" and it doesn't install the manual page
287at all.
288
289The only thing you may have to install manually is the Python mode for
290Emacs. (But then again, more recent versions of Emacs may already
291have it!) This is the file Misc/python-mode.el; follow the
292instructions that came with Emacs for installation of site specific
293files.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000294
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000295
296Configuration options and variables
297-----------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000298
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000299Some special cases are handled by passing options to the configure
300script.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000301
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000302WARNING: if you rerun the configure script with different options, you
303must run "make clean" before rebuilding. Exceptions to this rule:
304after changing --prefix or --exec-prefix, all you need to do is remove
305Modules/getpath.o; after changing --with-readline, just remove
306Parser/myreadline.o.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000307
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000308--with(out)-gcc: The configure script uses gcc (the GNU C compiler) if
309 it finds it. If you don't want this, or if this compiler is
310 installed but broken on your platform, pass the option
311 --without-gcc. You can also pass "CC=cc" (or whatever the
312 name of the proper C compiler is) in the environment, but the
313 advantage of using --without-gcc is that this option is
314 remembered by the config.status script for its --recheck
315 option.
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000316
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000317--prefix, --exec-prefix: If you want to install the binaries and the
318 Python library somewhere else than in /usr/local/{bin,lib},
319 you can pass the option --prefix=DIRECTORY; the interpreter
320 binary will be installed as DIRECTORY/bin/python and the
321 library files as DIRECTORY/lib/python/*. If you pass
322 --exec-prefix=DIRECTORY (as well) this overrides the
323 installation prefix for architecture-dependent files (like the
324 interpreter binary). Note that --prefix=DIRECTORY also
325 affects the default module search path (sys.path), when
326 Modules/config.c is compiled. Passing make the option
327 prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the
328 prefix set at configuration time; this may be more convenient
329 than re-running the configure script if you change your mind
330 about the install prefix...
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000331
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000332--with-readline: You can use the GNU readline library to improve the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000333 interactive user interface. This gives you line editing and
334 command history when calling Python interactively. Unless GNU
335 readline is a standard part of your system (it is on Linux),
336 you need to configure build the GNU readline library before
337 running the configure script. Its sources are not distributed
338 with Python; you can ftp them from any GNU mirror site, or
339 from its home site:
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000340 ftp://slc2.ins.cwru.edu/pub/dist/readline-2.0.tar.gz (or
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000341 a higher version number -- using version 1.x is not
342 recommended).
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000343
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000344 A GPL-free version was posted to comp.sources.misc in volume
345 31 and is widely available from FTP archive sites, e.g.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000346 ftp://gatekeeper.dec.com/.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000347
348 Pass the Python configure script the option
349 --with-readline=DIRECTORY where DIRECTORY is the absolute
350 pathname of the directory where you've built the readline
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000351 library. If GNU readline is a standard part of your system,
352 don't pass '=DIRECTORY'. Some hints on building and using the
353 readline library are in the FAQ (file Misc/FAQ).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000354
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000355--with-thread: On most Unix systems, you can now use multiple threads.
356 To enable this, pass --with-thread. If the library required
357 for threads lives in a peculiar place, you can use
358 --with-thread=DIRECTORY. In the Modules/Setup file, enable
359 the thread module. (Threads aren't enabled automatically
360 because there are run-time penalties when support for them is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000361 compiled in even if you don't use them.) IMPORTANT: run "make
362 clean" after changing (either enabling or disabling) this
363 option!
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000364
365--with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is
366 supported by the "dl" library by Jack Jansen, which is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000367 ftp'able from ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000368 This is enabled (after you've ftp'ed and compiled the dl
369 library!) by passing --with-sgi-dl=DIRECTORY where DIRECTORY
370 is the absolute pathname of the dl library. (Don't bother on
371 IRIX 5, it already has dynamic linking using SunOS style
372 shared libraries.) Support for this feature is deprecated.
373
374--with-dl-dld: Dynamic loading of modules is rumoured to be supported
375 on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent
376 Symmetry (Dynix), and Atari ST. This is done using a
377 combination of the GNU dynamic loading package
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000378 (ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z) and an
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000379 emulation of the SGI dl library mentioned above (the emulation
380 can be found at
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000381 ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z). To
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000382 enable this, ftp and compile both libraries, then call the
383 configure passing it the option
384 --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is
385 the absolute pathname of the dl emulation library and
386 DLD_DIRECTORY is the absolute pathname of the GNU dld library.
387 (Don't bother on SunOS 4 or 5, they already have dynamic
388 linking using shared libraries.) Support for this feature is
389 deprecated.
390
391--with-libm, --with-libc: It is possible to specify alternative
392 versions for the Math library (default -lm) and the C library
393 (default the empty string) using the options
394 --with-libm=STRING and --with-libc=STRING, respectively. E.g.
395 if your system requires that you pass -lc_s to the C compiler
396 to use the shared C library, you can pass --with-libc=-lc_s.
397 These libraries are passed after all other libraries, the C
398 library last.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +0000399
400--with-next-archs='arch1 arch2': Under NEXTSTEP, this will build
401 all compiled binaries with the architectures listed. Includes
402 correctly setting the target architecture specific resource
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000403 directory. (This option is not supported on other platforms.)
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000404
Guido van Rossumd02ba451996-07-31 17:36:01 +0000405--with-libs='libs': Add 'libs' to the LIBS that the python
406 linked against.
407
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000408
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000409Building for multiple architectures (using the VPATH feature)
410-------------------------------------------------------------
411
412If your file system is shared between multiple architectures, it
413usually is not necessary to make copies of the sources for each
414architecture you want to support. If the make program supports the
415VPATH feature, you can create an empty build directory for each
416architecture, and in each directory run the configure script (on the
417appropriate machine with the appropriate options). This creates the
418necessary subdirectories and the Makefiles therein. The Makefiles
419contain a line VPATH=... which points to directory containing the
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000420actual sources. (On SGI systems, use "smake -J1" instead of "make" if
421you use VPATH -- don't try gnumake.)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000422
423For example, the following is all you need to build a minimal Python
424in /usr/tmp/python (assuming ~guido/src/python is the toplevel
425directory and you want to build in /usr/tmp/python):
426
427 $ mkdir /usr/tmp/python
428 $ cd /usr/tmp/python
429 $ ~guido/src/python/configure
430 [...]
431 $ make
432 [...]
433 $
434
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000435Note that Modules/Makefile copies the original Setup file to the build
436directory if it finds no Setup file there. This means that you can
437edit the Setup file for each architecture independently. For this
438reason, subsequent changes to the original Setup file are not tracked
439automatically, as they might overwrite local changes. To force a copy
440of a changed original Setup file, delete the target Setup file. (The
441makesetup script supports multiple input files, so if you want to be
442fancy you can change the rules to create an empty Setup.local if it
443doesn't exist and run it with arguments $(srcdir)/Setup Setup.local;
444however this assumes that you only need to add modules.)
445
446
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000447Building on non-UNIX systems
448----------------------------
449
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000450Building Python for a PC is now a piece of cake!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000451
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000452Enter the directory "PC" and read the file "readme.txt". Most popular
453non-Unix PC platforms and compilers are supported (Unix ports to the
454PC such as Linux, FreeBSD or Solaris-x86 of course use the standard
455Unix build instructions).
456
457For the Mac, a separate source distribution will be made available,
458for use with the CodeWarrior compiler. If you are interested in Mac
459development, join the PythonMac Special Interest Group
460(http://www.python.org/sigs/pythonmac-sig/, or send email to
461pythonmac-sig-request@python.org).
462
463Of course, there are also binary distributions available for these
464platforms -- see http://www.python.org/python/.
465
466To port Python to a new non-UNIX system, you will have to fake the
467effect of running the configure script manually (for Mac and PC, this
468has already been done for you). A good start is to copy the file
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000469config.h.in to config.h and edit the latter to reflect the actual
470configuration of your system. Most symbols must simply be defined as
4711 only if the corresponding feature is present and can be left alone
472otherwise; however RETSIGTYPE must always be defined, either as int or
473as void, and the *_t type symbols must be defined as some variant of
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000474int if they need to be defined at all.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000475
476
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000477
478Miscellaneous issues
479====================
480
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000481Documentation
482-------------
483
484All documentation is provided in the subdirectory Doc in the form of
485LaTeX files. In order of importance for new users: Tutorial (tut),
486Library Reference (lib), Language Reference (ref), Extending (ext).
487Especially the Library Reference is of immense value since much of
488Python's power (including the built-in data types and functions!) is
489described here.
490
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000491To print the documentation from the LaTeX files, chdir into the Doc
492subdirectory, type "make" (let's hope you have LaTeX installed!), and
493send the four resulting PostScript files (tut.ps, lib.ps, ref.ps, and
494ext.ps) to the printer. See the README file there. If you don't have
495LaTeX, you can ftp the PostScript files from the ftp archives (see
496below).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000497
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000498All documentation is also available on-line via the Python web site
499(http://www.python.org/, see below). It can also be downloaded
500separately from the ftp archives (see below) in Emacs INFO, HTML or
501PostScript form -- see the web site or the FAQ (file Misc/FAQ) for
502more info.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000503
504
505Emacs mode
506----------
507
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000508There's an excellent Emacs editing mode for Python code; see the file
509Misc/python-mode.el. Originally written by Tim Peters, it is now
510maintained by Barry Warsaw <bwarsaw@cnri.reston.va.us>.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000511
512
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000513Web site
514--------
515
516Python's own web site has URL http://www.python.org/. Come visit us!
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000517There are a number of mirrors, listed on the home page -- try a mirror
518that's close you you.
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000519
520
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000521Ftp site
522--------
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000523
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000524Python's own ftp site is ftp.python.org, directory /pub/python. See
525the FAQ (file Misc/FAQ) for a list of other ftp sites carrying the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000526Python distribution.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000527
528
529Newsgroup and mailing list
530--------------------------
531
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000532There are a newsgroup and a mailing list devoted to Python. The
533newsgroup, comp.lang.python, contains exactly the same messages as the
534mailing list (though not always in the same order, due to the
535mysterious nature of the Usenet news distribution algorithm). To
536subscribe to the mailing list, send mail containing your real name and
537e-mail address to "python-list-request@cwi.nl". Use the same address
538if you want to unsibscribed. (A real person reads these messages, so
539no LISTPROC or Majordomo commands, please, and please be patient --
540normal turn-around time is about one working day.)
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000541
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000542The Python web site contains a search form that lets you search the
543newsgroup archives (or the web site itself). Click on the "search"
544link in the banner menu on any page of http://www.python.org/.
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000545
546
547Bug reports
548-----------
549
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000550Bugs are best reported to the comp.lang.python newsgroup or the Python
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000551mailing list -- see the section "Newsgroup and mailing list" above.
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000552Before posting, check the newsgroup archives (see above) to see if
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000553your bug has already been reported!
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000554
555
556Questions
557---------
558
559For help, if you can't find it in the manuals, the FAQ or on the web
560site, it's best to post to the comp.lang.python or the Python mailing
561list (see above). If you specifically don't want to involve the
562newsgroup or mailing list, send questions to python-help@python.org.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000563
564
565The Tk interface
566----------------
567
568Tk (the user interface component of John Ousterhout's Tcl language) is
569also usable from Python. Since this requires that you first build and
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000570install Tcl/Tk, the Tk interface is not enabled by default. It works
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000571with Tcl 7.5 and Tk 4.1 as well as with Tcl 7.4 and Tk 4.0. I didn't
572have the time to test it with Tcl 7.6 and Tk 4.2 yet, but it might
573well work.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000574
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000575See http://www.sunlabs.com/research/tcl/ for more info on where to get
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000576Tcl/Tk.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000577
578To enable the Python/Tk interface, once you've built and installed
579Tcl/Tk, all you need to do is edit two lines in Modules/Setup; search
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000580for the string "_tkinter". Uncomment one (normally the first) of the
581lines beginning with "#_tkinter" and un-comment the line beginning
582with "#TKPATH". If you have installed Tcl/Tk or X11 in unusual
583places, you will have to edit the first line to fix or add -I and -L
584options. See the Build Instructions above for more details.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000585
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000586There is little documentation on how to use Tkinter; however most of
587the Tk manual pages apply quite straightforwardly. Begin with
588fetching the "Tk Lifesaver" document,
589e.g. ftp://ftp.python.org/pub/python/doc/tkinter-doc.tar.gz (a gzipped
590tar file containing a PostScript file) or the on-line version
591http://www.python.org/doc/life-preserver/index.html. Reading the
592Tkinter.py source will reveal most details on how Tkinter calls are
593translated into Tcl code.
594
595There are demos in the Demo/tkinter directory, in the subdirectories
596guido, matt and www (the matt and guido subdirectories have been
597overhauled to use more recent Tkinter coding conventions).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000598
599Note that there's a Python module called "Tkinter" (capital T) which
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000600lives in Lib/tkinter/Tkinter.py, and a C module called "_tkinter"
601(lower case t and leading underscore) which lives in
602Modules/_tkinter.c. Demos and normal Tk applications only import the
603Python Tkinter module -- only the latter uses the C _tkinter module
604directly. In order to find the C _tkinter module, it must be compiled
605and linked into the Python interpreter -- the _tkinter line in the
606Setup file does this. In order to find the Python Tkinter module,
607sys.path must be set correctly -- the TKPATH assignment in the Setup
608file takes care of this, but only if you install Python properly
609("make install libinstall"). (You can also use dynamic loading for
610the C _tkinter module, in which case you must manually fix up sys.path
611or set $PYTHONPATH for the Python Tkinter module.)
Guido van Rossum84c8c7f1995-08-28 02:44:24 +0000612
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000613
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000614Distribution structure
615----------------------
616
617Most subdirectories have their own README file. Most files have
618comments.
619
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000620BUGS A list of known bugs (not completely up-to-date)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000621Demo/ Demonstration scripts, modules and programs
622Doc/ Documentation (LaTeX sources)
623Grammar/ Input for the parser generator
624Include/ Public header files
625Lib/ Python library modules
626Makefile.in Source from which config.status creates Makefile
627Misc/ Miscellaneous files
628Modules/ Implementation of most built-in modules
629Objects/ Implementation of most built-in object types
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000630PC/ PC porting files (DOS, Windows, NT, OS/2)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000631Parser/ The parser and tokenizer and their input handling
632Python/ The "compiler" and interpreter
633README The file you're reading now
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000634TODO A list of things that could be done (not up-to-date)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000635Tools/ Some useful programs written in Python
636acconfig.h Additional input for the autoheader program
637config.h.in Source from which config.status creates config.h
638configure Configuration shell script (GNU autoconf output)
639configure.in Configuration specification (GNU autoconf input)
640install-sh Shell script used to install files
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000641
642The following files will (may) be created in the toplevel directory by
643the configuration and build processes:
644
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000645Makefile Build rules
646config.cache cache of configuration variables
647config.h Configuration header
648config.log log from last configure run
649config.status status from last run of configure script
650python The executable interpreter
651tags, TAGS Tags files for vi and Emacs
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000652
653
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000654Author's address
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000655================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000656
657Guido van Rossum
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000658CNRI
6591895 Preston White Drive
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000660Reston, VA 20191
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000661USA
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000662
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000663E-mail: guido@cnri.reston.va.us or guido@python.org
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000664
665
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000666
667Copyright notice
668================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000669
670The Python source is copyrighted, but you can freely use and copy it
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000671as long as you don't change or remove the copyright notice:
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000672
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000673----------------------------------------------------------------------
Guido van Rossumaf5b83e1995-01-04 19:02:35 +0000674Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
675The Netherlands.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000676
677 All Rights Reserved
678
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000679Permission to use, copy, modify, and distribute this software and its
680documentation for any purpose and without fee is hereby granted,
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000681provided that the above copyright notice appear in all copies and that
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000682both that copyright notice and this permission notice appear in
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000683supporting documentation, and that the names of Stichting Mathematisch
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000684Centrum or CWI or Corporation for National Research Initiatives or
685CNRI not be used in advertising or publicity pertaining to
686distribution of the software without specific, written prior
687permission.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000688
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000689While CWI is the initial source for this software, a modified version
690is made available by the Corporation for National Research Initiatives
691(CNRI) at the Internet address ftp://ftp.python.org.
692
693STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
694REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
695MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
696CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
697DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
698PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
699TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
700PERFORMANCE OF THIS SOFTWARE.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000701----------------------------------------------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000702
703
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000704--Guido van Rossum (home page: http://www.python.org/~guido/)