blob: 06d00977bcc0f16d6459c6d28b4200d1c4fda71e [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 Rossum6d9cc801996-08-01 17:31:22 +00004It's a beta release. Use this if you want to help me iron the last
5wrinkles out of the distribution before I release the real version
61.4. In particular, I'm interested in porting experiences to Unix
7boxes. Python should build out of the box using "./configure; make".
Guido van Rossumfaf681a1996-06-20 14:32:08 +00008Also try running configue with the --with-thread and --with-readline
Guido van Rossum6d9cc801996-08-01 17:31:22 +00009options (described below). AIX users: please try the new shared
10library support!
Guido van Rossum627b2d71993-12-24 10:39:16 +000011
Guido van Rossum627b2d71993-12-24 10:39:16 +000012
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +000013What's new in this release?
14---------------------------
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000015
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +000016A list of things that changed since 1.4 beta 1 can be found in
17Misc/NEWS. This file will eventually be updated to also list what's
Guido van Rossum6d9cc801996-08-01 17:31:22 +000018new since to 1.3; in the mean time, you can have a look at
19http://www.python.org/workshops/1996-06/future.html (though there are
20some minor deviations from what was promised there, as usual).
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000021
22
Guido van Rossum91cb9d21995-04-10 11:47:38 +000023What is Python anyway?
24----------------------
25
26Python is an interpreted object-oriented programming language, and is
Guido van Rossum6d9cc801996-08-01 17:31:22 +000027often compared to Tcl, Perl, Scheme or Java. For a quick summary of
28what Python can mean for a UNIX/C programmer, read Misc/BLURB.LUTZ.
29If you have web access, point your browser to
30http://www.python.org.
Guido van Rossum91cb9d21995-04-10 11:47:38 +000031
32
33If you don't read instructions
34------------------------------
35
36Congratulations on getting this far. :-)
37
38To start building right away (on UNIX): type "./configure" in the
39current directory and when it finishes, type "make". The section
40Build Instructions below is still recommended reading. :-)
41
42
43Copyright issues
44----------------
45
46Python is COPYRIGHTED but free to use for all. See the full copyright
47notice at the end of this file.
48
49The Python distribution is *not* affected by the GNU Public Licence
50(GPL). There are interfaces to some GNU code but these are entirely
51optional and no GNU code is distributed with Python. For all these
52packages, GPL-free public domain versions also exist.
53
Guido van Rossum627b2d71993-12-24 10:39:16 +000054
Guido van Rossum6d9cc801996-08-01 17:31:22 +000055
Guido van Rossumff840491995-09-18 22:02:47 +000056A modest plug
57=============
58
Guido van Rossum0447a321995-10-08 01:22:33 +000059*************************************************************************
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000060* *
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +000061* If you use Python, please consider joining the Python Software *
62* Activity (PSA). See http://www.python.org/psa/. *
63* *
64* Organizations making heavy use of Python are especially invited *
65* to become corporate members! *
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000066* *
Guido van Rossum0447a321995-10-08 01:22:33 +000067*************************************************************************
Guido van Rossumff840491995-09-18 22:02:47 +000068
Guido van Rossum627b2d71993-12-24 10:39:16 +000069
Guido van Rossum6d9cc801996-08-01 17:31:22 +000070
Guido van Rossum433c8ad1994-08-01 12:07:07 +000071Build instructions
Guido van Rossum91cb9d21995-04-10 11:47:38 +000072==================
Guido van Rossum627b2d71993-12-24 10:39:16 +000073
Guido van Rossum6d9cc801996-08-01 17:31:22 +000074Before you can build Python, you must first configure it.
75Fortunately, the configuration and build process has been streamlined
76for most Unix installations, so all you have to do is type a few
77commands, optionally edit one file, and sit back. There are some
78platforms where things are not quite as smooth; see the platform
79specific notes below. If you want to build for multiple platforms
80sharing the same source tree, see the section on VPATH below.
Guido van Rossum627b2d71993-12-24 10:39:16 +000081
Guido van Rossum6d9cc801996-08-01 17:31:22 +000082You start by running the script "./configure", which figures out your
83system configuration and creates several Makefiles. (It takes a
84minute or two -- please be patient!) When it's done, you are ready to
85run make. You may want to pass options to the configure script -- see
86the section below on configuration options and variables.
87
88To build Python, you normally type "make" in the toplevel directory.
89This will recursively run make in each of the subdirectories Parser,
90Objects, Python and Modules, creating a library file in each one. The
91executable of the interpreter is built in the Modules subdirectory and
92moved up here when it is built. If you want or need to, you can also
93chdir into each subdirectory in turn and run make there manually (do
94the Modules subdirectory last!).
95
96Once you have built an interpreter, see the subsections below on
97testing, configuring additional modules, and installation. If you run
98in trouble, see the next section.
Guido van Rossum627b2d71993-12-24 10:39:16 +000099
Guido van Rossum0a516c91994-09-12 10:58:40 +0000100
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000101Troubleshooting
102---------------
Guido van Rossum627b2d71993-12-24 10:39:16 +0000103
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000104See also the platform specific notes in the next section.
105
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000106If recursive makes fail, try invoking make as "make MAKE=make".
107
108If you run into other trouble, see section 3 of the FAQ (file
109Misc/FAQ) for hints on what can go wrong, and how to fix it.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000110
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000111If you rerun the configure script with different options, remove all
112object files by running "make clean" before rebuilding. Believe it or
113not, "make clean" sometimes helps to clean up other inexplicable
114problems as well. Try it before sending in a bug report!
115
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000116
117Platform specific notes
118-----------------------
119
Guido van Rossum0447a321995-10-08 01:22:33 +0000120(Some of these may no longer apply. If you find you can build Python
121on these platforms without the special directions mentioned here, let
122me know so I can remove them!)
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000123
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000124Linux: On Linux version 1.x, once you've built Python, use it to run
125 the regen script in the Lib/linux1 directory. Apparently
126 the files as distributed don't match the system headers on
127 some Linux versions. (The "h2py" command refers to
128 Tools/scripts/h2py.py.) The modules distributed for Linux 2.x
129 should be okay.
Guido van Rossum8eca2c21996-02-14 18:37:46 +0000130
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000131AIX: The notes in Misc/AIX-NOTES probably no longer apply. A
132 complete overhaul of the shared library support is now in
133 place, the only thing that's missing is a bit of explanation.
134 Search for AIX in Modules/Setup(.in) for a clue.
135
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000136 WARNING! In some versions of AIX, you get errors about
137 Invalid Indent when running the Python test set. This appears
138 to be a bug in the AIX compiler. Rebuild Parser/tokenizer.c
139 using OPT="" or OPT=-g, or use gcc.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000140
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000141HP-UX: Read the file Misc/HPUX-NOTES if you want to be able to
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000142 use shared libraries for dynamically loaded modules.
143
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000144Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"!
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000145
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000146SCO: 1) Everything works much better if you add -U__STDC__ to the
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000147 defs. This is because all the SCO header files are broken.
148 Anything that isn't mentioned in the C standard it's
149 conditionally excluded when __STDC__ is defined.
150
151 2) Due to the U.S. export restrictions, SCO broke the crypt
152 stuff out into a separate library, libcrypt_i.a so the LIBS
153 needed be set to:
154
155 LIBS=' -lsocket -lcrypt_i'
156
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000157 3) According to at least one report, the above apply only to
158 SCO 3 -- Python builds out of the box on SCO 5.
159
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000160SunOS: On SunOS 4.x, when using the native "cc" compiler, you have to
161 disable modules "cmath" and "operator" in Modules/Setup (see
162 the next section) and edit the various Makefiles to add
163 "-DWITHOUT_COMPLEX" to the CFLAGS variable, in order to
164 overcome the limitation to pre-ANSI C. (Or, of course, you
165 could get gcc :-).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000166
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000167NeXT: Some more changes are in the works, but were submitted too
168 late to make it to beta2. You may want to remove "-Wall" from
169 the OPT variable, for instance, unless you are a masochist.
170
171
172Configuring additional built-in modules
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000173---------------------------------------
Guido van Rossum19e0c261995-01-17 16:36:34 +0000174
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000175You can configure the interpreter to contain fewer or more built-in
176modules by editing the file Modules/Setup. This file is initially
177copied (when the toplevel Makefile makes Modules/Makefile for the
178first time) from Setup.in; if it does not exist yet, make a copy
179yourself. Never edit Setup.in -- always edit Setup. Read the
180comments in the file for information on what kind of edits you can
181make. When you have edited Setup, Makefile and config.c in Modules
182will automatically be rebuilt the next time you run make in the
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000183toplevel directory. (When working inside the Modules directory, use
184"make Makefile; make".)
Guido van Rossum627b2d71993-12-24 10:39:16 +0000185
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000186The default collection of modules should build on any Unix system, but
187many optional modules should work on all modern Unices (e.g. try dbm,
188mis, termios, timing, syslog, curses, new, soundex, parser). Often
189the quickest way to determine whether a particular module works or not
190is to see if it will build: enable it in Setup, then if you get
191compilation or link errors, disable it -- you're missing support.
192
193On SGI IRIX, there are modules that interface to many SGI specific
194system libraries, e.g. the GL library and the audio hardware.
195
196For SunOS and Solaris, enable module "sunaudiodev" to support the
197audio device.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000198
199
200Setting the optimization/debugging options
201------------------------------------------
202
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000203If you want or need to change the optimization/debugging options for
204the C compiler, assign to the OPT variable on the toplevel make
205command; e.g. "make OPT=-g" will build a debugging version of Python
206on most platforms. The default is OPT=-O; a value for OPT in the
207environment when the configure script is run overrides this default
208(likewise for CC; and the initial value for LIBS is used as the base
209set of libraries to link with).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000210
211
212Testing
213-------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000214
215To test the interpreter that you have just built, type "make test".
216This runs the test set silently, twice (once with no compiled files,
217once with the compiled files left by the previous test run). Each
218test run should print "All tests OK." and nothing more. (The test set
219does not test the built-in modules, but will find most other problems
220with the interpreter.)
221
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000222IMPORTANT: If the tests fail and you decide to mail a bug report,
223*don't* include the output of "make test". It is useless. Run the
224following command instead:
225
226 PYTHONPATH=../Lib:../Lib/test:./Modules ./python -c 'import testall'
227
228(substituting the top of the source tree for .. if you built in a
229different directory). This gives the output of the tests and shows
230which test failed.
231
232
233Installing
234----------
235
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000236Installing Python was never this easy!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000237
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000238To install the Python binary, library modules, shared library modules
239(see below), include files, configuration files, and the manual page,
240just type "make install". This will install all platform-independent
241files in subdirectories the directory given with the --prefix option
242to configure or the 'prefix' Make variable (default /usr/local), and
243all binary and other platform-specific files in subdirectories if the
244directory given by --exec-prefix or the 'exec_prefix' Make variable
245(defaults to the --prefix directory). All subdirectories created will
246have Python's version number in their name, e.g. the library modules
247are installed in "/usr/local/lib/python1.4/" by default. The Python
248binary is installed as "python1.4" and a hard link named "python" is
249created. The only file not installed with a version number in its
250name is the manual page, installed as "/usr/local/man/man1/python.1"
251by default.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000252
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000253If you have a previous installation of a pre-1.4 Python that you don't
254want to replace yet, use "make altinstall". This installs the same
255set of files as "make install" except it doesn't create the hard link
256to "python1.4" named "python" and it doesn't install the manual page
257at all.
258
259The only thing you may have to install manually is the Python mode for
260Emacs. (But then again, more recent versions of Emacs may already
261have it!) This is the file Misc/python-mode.el; follow the
262instructions that came with Emacs for installation of site specific
263files.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000264
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000265
266Configuration options and variables
267-----------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000268
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000269Some special cases are handled by passing options to the configure
270script.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000271
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000272WARNING: if you rerun the configure script with different options, you
273must run "make clean" before rebuilding. Exceptions to this rule:
274after changing --prefix or --exec-prefix, all you need to do is remove
275Modules/getpath.o; after changing --with-readline, just remove
276Parser/myreadline.o.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000277
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000278--with(out)-gcc: The configure script uses gcc (the GNU C compiler) if
279 it finds it. If you don't want this, or if this compiler is
280 installed but broken on your platform, pass the option
281 --without-gcc. You can also pass "CC=cc" (or whatever the
282 name of the proper C compiler is) in the environment, but the
283 advantage of using --without-gcc is that this option is
284 remembered by the config.status script for its --recheck
285 option.
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000286
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000287--prefix, --exec-prefix: If you want to install the binaries and the
288 Python library somewhere else than in /usr/local/{bin,lib},
289 you can pass the option --prefix=DIRECTORY; the interpreter
290 binary will be installed as DIRECTORY/bin/python and the
291 library files as DIRECTORY/lib/python/*. If you pass
292 --exec-prefix=DIRECTORY (as well) this overrides the
293 installation prefix for architecture-dependent files (like the
294 interpreter binary). Note that --prefix=DIRECTORY also
295 affects the default module search path (sys.path), when
296 Modules/config.c is compiled. Passing make the option
297 prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the
298 prefix set at configuration time; this may be more convenient
299 than re-running the configure script if you change your mind
300 about the install prefix...
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000301
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000302--with-readline: You can use the GNU readline library to improve the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000303 interactive user interface. This gives you line editing and
304 command history when calling Python interactively. Unless GNU
305 readline is a standard part of your system (it is on Linux),
306 you need to configure build the GNU readline library before
307 running the configure script. Its sources are not distributed
308 with Python; you can ftp them from any GNU mirror site, or
309 from its home site:
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000310 ftp://slc2.ins.cwru.edu/pub/dist/readline-2.0.tar.gz (or
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000311 a higher version number -- using version 1.x is not
312 recommended).
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000313
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000314 A GPL-free version was posted to comp.sources.misc in volume
315 31 and is widely available from FTP archive sites, e.g.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000316 ftp://gatekeeper.dec.com/.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000317
318 Pass the Python configure script the option
319 --with-readline=DIRECTORY where DIRECTORY is the absolute
320 pathname of the directory where you've built the readline
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000321 library. If GNU readline is a standard part of your system,
322 don't pass '=DIRECTORY'. Some hints on building and using the
323 readline library are in the FAQ (file Misc/FAQ).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000324
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000325--with-thread: On most Unix systems, you can now use multiple threads.
326 To enable this, pass --with-thread. If the library required
327 for threads lives in a peculiar place, you can use
328 --with-thread=DIRECTORY. In the Modules/Setup file, enable
329 the thread module. (Threads aren't enabled automatically
330 because there are run-time penalties when support for them is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000331 compiled in even if you don't use them.) IMPORTANT: run "make
332 clean" after changing (either enabling or disabling) this
333 option!
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000334
335--with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is
336 supported by the "dl" library by Jack Jansen, which is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000337 ftp'able from ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000338 This is enabled (after you've ftp'ed and compiled the dl
339 library!) by passing --with-sgi-dl=DIRECTORY where DIRECTORY
340 is the absolute pathname of the dl library. (Don't bother on
341 IRIX 5, it already has dynamic linking using SunOS style
342 shared libraries.) Support for this feature is deprecated.
343
344--with-dl-dld: Dynamic loading of modules is rumoured to be supported
345 on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent
346 Symmetry (Dynix), and Atari ST. This is done using a
347 combination of the GNU dynamic loading package
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000348 (ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z) and an
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000349 emulation of the SGI dl library mentioned above (the emulation
350 can be found at
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000351 ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z). To
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000352 enable this, ftp and compile both libraries, then call the
353 configure passing it the option
354 --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is
355 the absolute pathname of the dl emulation library and
356 DLD_DIRECTORY is the absolute pathname of the GNU dld library.
357 (Don't bother on SunOS 4 or 5, they already have dynamic
358 linking using shared libraries.) Support for this feature is
359 deprecated.
360
361--with-libm, --with-libc: It is possible to specify alternative
362 versions for the Math library (default -lm) and the C library
363 (default the empty string) using the options
364 --with-libm=STRING and --with-libc=STRING, respectively. E.g.
365 if your system requires that you pass -lc_s to the C compiler
366 to use the shared C library, you can pass --with-libc=-lc_s.
367 These libraries are passed after all other libraries, the C
368 library last.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +0000369
370--with-next-archs='arch1 arch2': Under NEXTSTEP, this will build
371 all compiled binaries with the architectures listed. Includes
372 correctly setting the target architecture specific resource
373 directory.
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000374
Guido van Rossumd02ba451996-07-31 17:36:01 +0000375--with-libs='libs': Add 'libs' to the LIBS that the python
376 linked against.
377
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000378
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000379Building for multiple architectures (using the VPATH feature)
380-------------------------------------------------------------
381
382If your file system is shared between multiple architectures, it
383usually is not necessary to make copies of the sources for each
384architecture you want to support. If the make program supports the
385VPATH feature, you can create an empty build directory for each
386architecture, and in each directory run the configure script (on the
387appropriate machine with the appropriate options). This creates the
388necessary subdirectories and the Makefiles therein. The Makefiles
389contain a line VPATH=... which points to directory containing the
Guido van Rossum6b111b01994-10-11 15:03:34 +0000390actual sources. (On SGI systems, use "smake" instead of "make" if you
391use VPATH -- don't try gnumake.)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000392
393For example, the following is all you need to build a minimal Python
394in /usr/tmp/python (assuming ~guido/src/python is the toplevel
395directory and you want to build in /usr/tmp/python):
396
397 $ mkdir /usr/tmp/python
398 $ cd /usr/tmp/python
399 $ ~guido/src/python/configure
400 [...]
401 $ make
402 [...]
403 $
404
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000405Note that Modules/Makefile copies the original Setup file to the build
406directory if it finds no Setup file there. This means that you can
407edit the Setup file for each architecture independently. For this
408reason, subsequent changes to the original Setup file are not tracked
409automatically, as they might overwrite local changes. To force a copy
410of a changed original Setup file, delete the target Setup file. (The
411makesetup script supports multiple input files, so if you want to be
412fancy you can change the rules to create an empty Setup.local if it
413doesn't exist and run it with arguments $(srcdir)/Setup Setup.local;
414however this assumes that you only need to add modules.)
415
416
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000417Building on non-UNIX systems
418----------------------------
419
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000420Building Python for a PC is now a piece of cake!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000421
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000422Enter the directory "PC" and read the file "readme.txt". Most popular
423non-Unix PC platforms and compilers are supported (Unix ports to the
424PC such as Linux, FreeBSD or Solaris-x86 of course use the standard
425Unix build instructions).
426
427For the Mac, a separate source distribution will be made available,
428for use with the CodeWarrior compiler. If you are interested in Mac
429development, join the PythonMac Special Interest Group
430(http://www.python.org/sigs/pythonmac-sig/, or send email to
431pythonmac-sig-request@python.org).
432
433Of course, there are also binary distributions available for these
434platforms -- see http://www.python.org/python/.
435
436To port Python to a new non-UNIX system, you will have to fake the
437effect of running the configure script manually (for Mac and PC, this
438has already been done for you). A good start is to copy the file
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000439config.h.in to config.h and edit the latter to reflect the actual
440configuration of your system. Most symbols must simply be defined as
4411 only if the corresponding feature is present and can be left alone
442otherwise; however RETSIGTYPE must always be defined, either as int or
443as void, and the *_t type symbols must be defined as some variant of
444int if they need to be defined at all. Then arrange that the symbol
445HAVE_CONFIG_H is defined during compilation (usually by passing an
446argument of the form `-DHAVE_CONFIG_H' to the compiler, but this is
447necessarily system-dependent).
448
449
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000450
451Miscellaneous issues
452====================
453
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000454Documentation
455-------------
456
457All documentation is provided in the subdirectory Doc in the form of
458LaTeX files. In order of importance for new users: Tutorial (tut),
459Library Reference (lib), Language Reference (ref), Extending (ext).
460Especially the Library Reference is of immense value since much of
461Python's power (including the built-in data types and functions!) is
462described here.
463
464To print the documentation from the LaTeX files, chdir into the Doc
465subdirectory, type "make" (let's hope you have LaTeX installed!), and
466send the four resulting PostScript files (tut.ps, lib.ps, ref.ps, and
467ext.ps) to the printer. See the README file there.
468
469All documentation is also available on-line via the World-Wide Web
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000470(WWW): http://www.python.org. It can also be downloaded
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000471separately from the ftp archives (see below) in Emacs INFO, HTML or
472PostScript form -- see the FAQ (file Misc/FAQ) for more info.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000473
474
475Emacs mode
476----------
477
478There's an excellent Emacs editing mode for Python code; see the file
479Misc/python-mode.el. Originally written by Tim Peters, who's no
480longer on the net, it is now maintained by Barry Warsaw
481<bwarsaw@cnri.reston.va.com>.
482
Guido van Rossum3c294ca1995-06-14 18:17:22 +0000483BTW, if you want to use font-lock for Python sources, here's something
484to put in your .emacs file:
485
486 (defun my-python-mode-hook ()
487 (setq font-lock-keywords python-font-lock-keywords)
488 (font-lock-mode 1))
489 (add-hook 'python-mode-hook 'my-python-mode-hook)
490
491
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000492
493Bug reports
494-----------
495
496Bugs are best reported to the comp.lang.python newsgroup or the Python
497mailing list -- see the section "Newsgroup and mailing list" below.
498Before posting, read the FAQ (file Misc/FAQ) first to see if your
499problem has already been answered!
500
501
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000502Web site
503--------
504
505Python's own web site has URL http://www.python.org/. Come visit us!
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000506There are a number of mirrors, listed on the home page -- try a mirror
507that's close you you.
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000508
509
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000510Ftp access
511----------
512
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000513Python's own ftp site is ftp.python.org, directory /pub/python. See
514the FAQ (file Misc/FAQ) for a list of other ftp sites carrying the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000515Python distribution.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000516
517
518Newsgroup and mailing list
519--------------------------
520
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000521There are a newsgroup and a mailing list devoted to Python. The
522newsgroup, comp.lang.python, contains exactly the same messages as the
523mailing list (though not always in the same order, due to the
524mysterious nature of Usenet news' flooding algorithms). To subscribe
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000525to the mailing list, send mail containing your real name and e-mail
526address to "python-list-request@cwi.nl" (a real person reads these
527messages, so no LISTPROC or Majordomo commands, please).
528
529
530The Tk interface
531----------------
532
533Tk (the user interface component of John Ousterhout's Tcl language) is
534also usable from Python. Since this requires that you first build and
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000535install Tcl/Tk, the Tk interface is not enabled by default. It works
536with Tcl 7.5 and Tk 4.1 as well as with Tcl 7.4 and Tk 4.0.
537
538See http://www.smli.com/research/tcl/ for more info on where to get
539Tcl/Tk.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000540
541To enable the Python/Tk interface, once you've built and installed
542Tcl/Tk, all you need to do is edit two lines in Modules/Setup; search
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000543for the string "_tkinter". Uncomment one (normally the first) of the
544lines beginning with "#_tkinter" and un-comment the line beginning
545with "#TKPATH". If you have installed Tcl/Tk or X11 in unusual
546places, you will have to edit the first line to fix or add -I and -L
547options. See the Build Instructions above for more details.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000548
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000549There is little documentation on how to use Tkinter; however most of
550the Tk manual pages apply quite straightforwardly. Begin with
551fetching the "Tk Lifesaver" document,
552e.g. ftp://ftp.python.org/pub/python/doc/tkinter-doc.tar.gz (a gzipped
553tar file containing a PostScript file) or the on-line version
554http://www.python.org/doc/life-preserver/index.html. Reading the
555Tkinter.py source will reveal most details on how Tkinter calls are
556translated into Tcl code.
557
558There are demos in the Demo/tkinter directory, in the subdirectories
559guido, matt and www (the matt and guido subdirectories have been
560overhauled to use more recent Tkinter coding conventions).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000561
562Note that there's a Python module called "Tkinter" (capital T) which
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000563lives in Lib/tkinter/Tkinter.py, and a C module called "_tkinter"
564(lower case t and leading underscore) which lives in
565Modules/_tkinter.c. Demos and normal Tk applications only import the
566Python Tkinter module -- only the latter uses the C _tkinter module
567directly. In order to find the C _tkinter module, it must be compiled
568and linked into the Python interpreter -- the _tkinter line in the
569Setup file does this. In order to find the Python Tkinter module,
570sys.path must be set correctly -- the TKPATH assignment in the Setup
571file takes care of this, but only if you install Python properly
572("make install libinstall"). (You can also use dynamic loading for
573the C _tkinter module, in which case you must manually fix up sys.path
574or set $PYTHONPATH for the Python Tkinter module.)
Guido van Rossum84c8c7f1995-08-28 02:44:24 +0000575
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000576
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000577Distribution structure
578----------------------
579
580Most subdirectories have their own README file. Most files have
581comments.
582
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000583BUGS A list of known bugs (not completely up-to-date)
584TODO A list of things that could be done (not up-to-date)
585Demo/ Demonstration scripts, modules and programs
586Doc/ Documentation (LaTeX sources)
587Grammar/ Input for the parser generator
588Include/ Public header files
589Lib/ Python library modules
590Makefile.in Source from which config.status creates Makefile
591Misc/ Miscellaneous files
592Modules/ Implementation of most built-in modules
593Objects/ Implementation of most built-in object types
594Parser/ The parser and tokenizer and their input handling
595Python/ The "compiler" and interpreter
596README The file you're reading now
597Tools/ Some useful programs written in Python
598acconfig.h Additional input for the autoheader program
599config.h.in Source from which config.status creates config.h
600configure Configuration shell script (GNU autoconf output)
601configure.in Configuration specification (GNU autoconf input)
602install-sh Shell script used to install files
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000603
604The following files will (may) be created in the toplevel directory by
605the configuration and build processes:
606
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000607Makefile Build rules
608config.cache cache of configuration variables
609config.h Configuration header
610config.log log from last configure run
611config.status status from last run of configure script
612python The executable interpreter
613tags, TAGS Tags files for vi and Emacs
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000614
615
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000616Author's address
617----------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000618
619Guido van Rossum
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000620CNRI
6211895 Preston White Drive
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000622Reston, VA 20191
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000623USA
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000624
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000625E-mail: guido@cnri.reston.va.or or guido@python.org
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000626
627
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000628
629Copyright notice
630================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000631
632The Python source is copyrighted, but you can freely use and copy it
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000633as long as you don't change or remove the copyright notice:
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000634
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000635----------------------------------------------------------------------
Guido van Rossumaf5b83e1995-01-04 19:02:35 +0000636Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
637The Netherlands.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000638
639 All Rights Reserved
640
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000641Permission to use, copy, modify, and distribute this software and its
642documentation for any purpose and without fee is hereby granted,
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000643provided that the above copyright notice appear in all copies and that
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000644both that copyright notice and this permission notice appear in
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000645supporting documentation, and that the names of Stichting Mathematisch
646Centrum or CWI not be used in advertising or publicity pertaining to
647distribution of the software without specific, written prior permission.
648
649STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
650THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
651FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
652FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
653WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
654ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
655OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000656----------------------------------------------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000657
658
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000659--Guido van Rossum (home page: http://www.python.org/~guido/)