Guido van Rossum | b06df27 | 1997-08-05 21:50:20 +0000 | [diff] [blame] | 1 | This is Python release 1.5 alpha 3 |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 2 | ================================== |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 3 | |
Guido van Rossum | 33fde57 | 1997-05-09 02:40:09 +0000 | [diff] [blame] | 4 | ****************************************** |
| 5 | *** RELEASE RESTRICTED TO PSA MEMBERS! *** |
| 6 | ****************************************** |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 7 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 8 | What's new in this release? |
| 9 | --------------------------- |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 10 | |
Guido van Rossum | b06df27 | 1997-08-05 21:50:20 +0000 | [diff] [blame] | 11 | Too much has changed to list it all; I'll be more complete later. |
Guido van Rossum | 33fde57 | 1997-05-09 02:40:09 +0000 | [diff] [blame] | 12 | |
Guido van Rossum | b06df27 | 1997-08-05 21:50:20 +0000 | [diff] [blame] | 13 | The most important changes since Python 1.4 include: |
| 14 | |
| 15 | - Many previously undocumented modules are now documented; some are |
| 16 | now officially obsolete or deprecated. |
| 17 | |
| 18 | - It's much faster (almost twice for pystone.py -- see Tools/scripts.) |
| 19 | |
| 20 | - There's an assert statement. |
| 21 | |
| 22 | - There's a -O option that removes SET_LINENO instructions and code |
| 23 | prefixed with ``if __debug__: ...''. |
| 24 | |
| 25 | - It's much smarter about the initial value for sys.path; you can |
| 26 | control it easier using $PYTHONHOME (see the usage message, e.g. try |
| 27 | ``python -h''). |
| 28 | |
| 29 | - The Grand Renaming is completed: all linker-visible symbols defined |
| 30 | by Python now have a "Py" or "_Py" prefix, and the same is true for |
| 31 | most macros and typedefs. |
| 32 | |
| 33 | - The build strategy now uses a single library (libpython1.5.a) which |
| 34 | contains everything except for the main() entry point. This makes |
| 35 | life much easier for applications that want to embed Python. |
| 36 | |
| 37 | - There is also much better support for embedding Python in |
| 38 | applications that use threads. |
| 39 | |
| 40 | - Unfinished projects: documentation; multiple independent |
| 41 | interpreters; more Windows support. |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 42 | |
| 43 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 44 | What is Python anyway? |
| 45 | ---------------------- |
| 46 | |
| 47 | Python is an interpreted object-oriented programming language, and is |
Guido van Rossum | 8d90f9d | 1997-05-22 20:13:25 +0000 | [diff] [blame] | 48 | often compared to Tcl, Perl, Java or Scheme. For a quick summary of |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 49 | what Python can mean for a UNIX/C programmer, read Misc/BLURB.LUTZ. |
Guido van Rossum | dfcf35d | 1996-08-26 17:52:09 +0000 | [diff] [blame] | 50 | If you have web access, point your browser to http://www.python.org. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 51 | |
| 52 | |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 53 | How do I learn Python? |
| 54 | ---------------------- |
| 55 | |
| 56 | The official tutorial is still a good place to start (in the Doc |
| 57 | directory as tut.tex; and http://www.python.org/doc/tut/tut.html). |
| 58 | Aaron Watters wrote a second tutorial, that may be more accessible for |
| 59 | some: http://www.wcmh.com/uworld/archives/95/tutorial/005.html. |
| 60 | |
Guido van Rossum | 8d90f9d | 1997-05-22 20:13:25 +0000 | [diff] [blame] | 61 | There are now also several books on Python. While these are still |
| 62 | based on Python 1.3 or 1.4, the language is so stable now that you'd |
| 63 | be hard pressed to find places where the books are out of date. The |
| 64 | first two books, both first published in October 1996 and both |
| 65 | including a CD-ROM, form excellent companions to each other: |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 66 | |
| 67 | Internet Programming with Python |
| 68 | by Aaron Watters, Guido van Rossum, and James Ahlstrom |
| 69 | MIS Press/Henry Holt publishers |
| 70 | ISBN: 1-55851-484-8 |
| 71 | |
| 72 | Programming Python |
| 73 | by Mark Lutz |
| 74 | O'Reilly & Associates |
| 75 | ISBN: 1-56592-197-6 |
| 76 | |
Guido van Rossum | 8d90f9d | 1997-05-22 20:13:25 +0000 | [diff] [blame] | 77 | If you prefer to read German, try: |
| 78 | |
| 79 | Das Python-Buch |
| 80 | by Martin von Loewis and Nils Fischbeck |
| 81 | Addison-Wesley-Longman, 1997 |
| 82 | ISBN: 3-8273-1110-1 |
| 83 | |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 84 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 85 | If you don't read instructions |
| 86 | ------------------------------ |
| 87 | |
| 88 | Congratulations on getting this far. :-) |
| 89 | |
| 90 | To start building right away (on UNIX): type "./configure" in the |
| 91 | current directory and when it finishes, type "make". The section |
| 92 | Build Instructions below is still recommended reading. :-) |
| 93 | |
| 94 | |
| 95 | Copyright issues |
| 96 | ---------------- |
| 97 | |
| 98 | Python is COPYRIGHTED but free to use for all. See the full copyright |
| 99 | notice at the end of this file. |
| 100 | |
| 101 | The Python distribution is *not* affected by the GNU Public Licence |
| 102 | (GPL). There are interfaces to some GNU code but these are entirely |
| 103 | optional and no GNU code is distributed with Python. For all these |
| 104 | packages, GPL-free public domain versions also exist. |
| 105 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 106 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 107 | |
Guido van Rossum | ff84049 | 1995-09-18 22:02:47 +0000 | [diff] [blame] | 108 | A modest plug |
| 109 | ============= |
| 110 | |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 111 | ********************************************************************* |
| 112 | * Without your help, I won't be able to continue to support Python! * |
| 113 | ********************************************************************* |
Guido van Rossum | ff84049 | 1995-09-18 22:02:47 +0000 | [diff] [blame] | 114 | |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 115 | If you use Python, please consider joining the Python Software |
| 116 | Activity (PSA). See http://www.python.org/psa/. |
| 117 | |
| 118 | Organizations that make heavy use of Python are especially encouraged |
| 119 | to become corporate members! |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 120 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 121 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 122 | Build instructions |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 123 | ================== |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 124 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 125 | Before you can build Python, you must first configure it. |
| 126 | Fortunately, the configuration and build process has been streamlined |
| 127 | for most Unix installations, so all you have to do is type a few |
| 128 | commands, optionally edit one file, and sit back. There are some |
| 129 | platforms where things are not quite as smooth; see the platform |
| 130 | specific notes below. If you want to build for multiple platforms |
| 131 | sharing the same source tree, see the section on VPATH below. |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 132 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 133 | You start by running the script "./configure", which figures out your |
| 134 | system configuration and creates several Makefiles. (It takes a |
| 135 | minute or two -- please be patient!) When it's done, you are ready to |
| 136 | run make. You may want to pass options to the configure script -- see |
| 137 | the section below on configuration options and variables. |
| 138 | |
| 139 | To build Python, you normally type "make" in the toplevel directory. |
| 140 | This will recursively run make in each of the subdirectories Parser, |
| 141 | Objects, Python and Modules, creating a library file in each one. The |
| 142 | executable of the interpreter is built in the Modules subdirectory and |
| 143 | moved up here when it is built. If you want or need to, you can also |
| 144 | chdir into each subdirectory in turn and run make there manually (do |
| 145 | the Modules subdirectory last!). |
| 146 | |
| 147 | Once you have built an interpreter, see the subsections below on |
| 148 | testing, configuring additional modules, and installation. If you run |
| 149 | in trouble, see the next section. |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 150 | |
Guido van Rossum | 0a516c9 | 1994-09-12 10:58:40 +0000 | [diff] [blame] | 151 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 152 | Troubleshooting |
| 153 | --------------- |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 154 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 155 | See also the platform specific notes in the next section. |
| 156 | |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 157 | If recursive makes fail, try invoking make as "make MAKE=make". |
| 158 | |
| 159 | If you run into other trouble, see section 3 of the FAQ (file |
| 160 | Misc/FAQ) for hints on what can go wrong, and how to fix it. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 161 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 162 | If you rerun the configure script with different options, remove all |
| 163 | object files by running "make clean" before rebuilding. Believe it or |
| 164 | not, "make clean" sometimes helps to clean up other inexplicable |
| 165 | problems as well. Try it before sending in a bug report! |
| 166 | |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 167 | If the configure script fails or doesn't seem to find things that |
| 168 | should be there, inspect the config.log file. |
| 169 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 170 | |
| 171 | Platform specific notes |
| 172 | ----------------------- |
| 173 | |
Guido van Rossum | 0447a32 | 1995-10-08 01:22:33 +0000 | [diff] [blame] | 174 | (Some of these may no longer apply. If you find you can build Python |
| 175 | on these platforms without the special directions mentioned here, let |
| 176 | me know so I can remove them!) |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 177 | |
Guido van Rossum | 4462e93 | 1997-01-22 21:00:32 +0000 | [diff] [blame] | 178 | Solaris: When using Sun's C compiler with threads, at least on Solaris |
| 179 | 2.5.1, you need to add the "-mt" compiler option (the simplest |
| 180 | way is probably to specify the compiler with this option as |
| 181 | the "CC" environment variable when running the configure |
| 182 | script). |
| 183 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 184 | Linux: On Linux version 1.x, once you've built Python, use it to run |
| 185 | the regen script in the Lib/linux1 directory. Apparently |
| 186 | the files as distributed don't match the system headers on |
| 187 | some Linux versions. (The "h2py" command refers to |
| 188 | Tools/scripts/h2py.py.) The modules distributed for Linux 2.x |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 189 | should be okay. Shared library support now works by default |
Guido van Rossum | 4462e93 | 1997-01-22 21:00:32 +0000 | [diff] [blame] | 190 | on ELF-based x86 Linux systems. (Note: when you change the |
| 191 | status of a module from static to shared, you must remove its |
| 192 | .o file or do a "make clean".) |
| 193 | |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 194 | DEC Unix: When enabling threads, use --with-dec-threads, not |
Guido van Rossum | 4462e93 | 1997-01-22 21:00:32 +0000 | [diff] [blame] | 195 | --with-thread. |
Guido van Rossum | 8eca2c2 | 1996-02-14 18:37:46 +0000 | [diff] [blame] | 196 | |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 197 | AIX: A complete overhaul of the shared library support is now in |
| 198 | place. To enable it, uncomment the LINKCC line in the Setup |
| 199 | file. See Misc/AIX-NOTES for some notes on how it's done. |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 200 | |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 201 | WARNING! In some versions of AIX, you get errors about |
Guido van Rossum | a3b4b61 | 1996-07-21 02:48:16 +0000 | [diff] [blame] | 202 | Invalid Indent when running the Python test set. This appears |
| 203 | to be a bug in the AIX compiler. Rebuild Parser/tokenizer.c |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 204 | using OPT="" or OPT=-g, or use gcc. According to the latest |
| 205 | reports, it seems this compiler bug is still present in 4.2.1. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 206 | |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 207 | HP-UX: Shared library support now works by default (at least on HP-UX |
| 208 | 9.x). One other problem remains: the HP ANSI C compiler (cc |
| 209 | -Aa) is too pedantic to use, but in K&R mode, it barfs on a |
| 210 | few files (complexobject.c, getargs.c and operator.c). Until |
| 211 | this is fixed, the following seems to work: |
| 212 | |
| 213 | make -k # this compiles all but a few files |
| 214 | make OPT=-Aa # compile the remaining files |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 215 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 216 | Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"! |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 217 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 218 | SCO: 1) Everything works much better if you add -U__STDC__ to the |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 219 | defs. This is because all the SCO header files are broken. |
| 220 | Anything that isn't mentioned in the C standard it's |
| 221 | conditionally excluded when __STDC__ is defined. |
| 222 | |
| 223 | 2) Due to the U.S. export restrictions, SCO broke the crypt |
| 224 | stuff out into a separate library, libcrypt_i.a so the LIBS |
| 225 | needed be set to: |
| 226 | |
| 227 | LIBS=' -lsocket -lcrypt_i' |
| 228 | |
Guido van Rossum | a3b4b61 | 1996-07-21 02:48:16 +0000 | [diff] [blame] | 229 | 3) According to at least one report, the above apply only to |
| 230 | SCO 3 -- Python builds out of the box on SCO 5. |
| 231 | |
Guido van Rossum | 4462e93 | 1997-01-22 21:00:32 +0000 | [diff] [blame] | 232 | SunOS: On SunOS 4.1.x, when using the SunPro C compiler, you may want |
| 233 | to use the '-Xa' option instead of '-Xc', to enable some |
| 234 | needed non-ANSI Sunisms. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 235 | |
Guido van Rossum | cc55c2d | 1996-10-21 15:14:27 +0000 | [diff] [blame] | 236 | NeXT: To build fat binaries, use the --with-next-archs switch |
| 237 | described below. |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 238 | |
Guido van Rossum | 40d6358 | 1997-08-14 19:45:30 +0000 | [diff] [blame] | 239 | QNX: Edit the top level Makefile to use the following compile options: |
| 240 | OPT = -Ox -Q -U_M_IX86 -U__WATCOMC__ |
| 241 | Edit the Makefile in the Modules directory to read: |
| 242 | LDFLAGS = -N 48k |
| 243 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 244 | |
| 245 | Configuring additional built-in modules |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 246 | --------------------------------------- |
Guido van Rossum | 19e0c26 | 1995-01-17 16:36:34 +0000 | [diff] [blame] | 247 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 248 | You can configure the interpreter to contain fewer or more built-in |
| 249 | modules by editing the file Modules/Setup. This file is initially |
| 250 | copied (when the toplevel Makefile makes Modules/Makefile for the |
| 251 | first time) from Setup.in; if it does not exist yet, make a copy |
| 252 | yourself. Never edit Setup.in -- always edit Setup. Read the |
| 253 | comments in the file for information on what kind of edits you can |
| 254 | make. When you have edited Setup, Makefile and config.c in Modules |
| 255 | will automatically be rebuilt the next time you run make in the |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 256 | toplevel directory. (When working inside the Modules directory, use |
| 257 | "make Makefile; make".) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 258 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 259 | The default collection of modules should build on any Unix system, but |
| 260 | many optional modules should work on all modern Unices (e.g. try dbm, |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 261 | nis, termios, timing, syslog, curses, new, soundex, parser). Often |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 262 | the quickest way to determine whether a particular module works or not |
| 263 | is to see if it will build: enable it in Setup, then if you get |
| 264 | compilation or link errors, disable it -- you're missing support. |
| 265 | |
| 266 | On SGI IRIX, there are modules that interface to many SGI specific |
| 267 | system libraries, e.g. the GL library and the audio hardware. |
| 268 | |
| 269 | For SunOS and Solaris, enable module "sunaudiodev" to support the |
| 270 | audio device. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 271 | |
Guido van Rossum | 4462e93 | 1997-01-22 21:00:32 +0000 | [diff] [blame] | 272 | In addition to the file Setup, you can also edit the file Setup.local. |
| 273 | (the makesetup script processes both). You may find it more |
| 274 | convenient to edit Setup.local and leave Setup alone. Then, when |
| 275 | installing a new Python version, you can copy your old Setup.local |
| 276 | file. |
| 277 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 278 | |
| 279 | Setting the optimization/debugging options |
| 280 | ------------------------------------------ |
| 281 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 282 | If you want or need to change the optimization/debugging options for |
| 283 | the C compiler, assign to the OPT variable on the toplevel make |
| 284 | command; e.g. "make OPT=-g" will build a debugging version of Python |
| 285 | on most platforms. The default is OPT=-O; a value for OPT in the |
| 286 | environment when the configure script is run overrides this default |
| 287 | (likewise for CC; and the initial value for LIBS is used as the base |
| 288 | set of libraries to link with). |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 289 | |
| 290 | |
| 291 | Testing |
| 292 | ------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 293 | |
| 294 | To test the interpreter that you have just built, type "make test". |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 295 | This runs the test set twice (once with no compiled files, once with |
| 296 | the compiled files left by the previous test run). The test set |
| 297 | produces some output. You can generally ignore the messages about |
| 298 | skipped tests due to an optional feature that can't be imported (if |
| 299 | you want to test those modules, edit Modules/Setup to configure them). |
| 300 | If a messages is printed about a failed test or a traceback or core |
| 301 | dump is produced, something's wrong. On some systems, test_strftime |
| 302 | fails due to a non-standard implementation of strftime() in the C |
| 303 | library. This can be ignored (or you can complain to your vendor). |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 304 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 305 | IMPORTANT: If the tests fail and you decide to mail a bug report, |
| 306 | *don't* include the output of "make test". It is useless. Run the |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 307 | test that fails manually, as follows: |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 308 | |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 309 | python ../Lib/test/test_whatever.py |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 310 | |
| 311 | (substituting the top of the source tree for .. if you built in a |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 312 | different directory). This runs the test in verbose mode. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 313 | |
| 314 | |
| 315 | Installing |
| 316 | ---------- |
| 317 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 318 | Installing Python was never this easy! |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 319 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 320 | To install the Python binary, library modules, shared library modules |
| 321 | (see below), include files, configuration files, and the manual page, |
| 322 | just type "make install". This will install all platform-independent |
| 323 | files in subdirectories the directory given with the --prefix option |
| 324 | to configure or the 'prefix' Make variable (default /usr/local), and |
| 325 | all binary and other platform-specific files in subdirectories if the |
| 326 | directory given by --exec-prefix or the 'exec_prefix' Make variable |
| 327 | (defaults to the --prefix directory). All subdirectories created will |
| 328 | have Python's version number in their name, e.g. the library modules |
Guido van Rossum | 33fde57 | 1997-05-09 02:40:09 +0000 | [diff] [blame] | 329 | are installed in "/usr/local/lib/python1.5/" by default. The Python |
| 330 | binary is installed as "python1.5" and a hard link named "python" is |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 331 | created. The only file not installed with a version number in its |
| 332 | name is the manual page, installed as "/usr/local/man/man1/python.1" |
| 333 | by default. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 334 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 335 | If you have a previous installation of a pre-1.4 Python that you don't |
| 336 | want to replace yet, use "make altinstall". This installs the same |
| 337 | set of files as "make install" except it doesn't create the hard link |
Guido van Rossum | 33fde57 | 1997-05-09 02:40:09 +0000 | [diff] [blame] | 338 | to "python1.5" named "python" and it doesn't install the manual page |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 339 | at all. |
| 340 | |
| 341 | The only thing you may have to install manually is the Python mode for |
| 342 | Emacs. (But then again, more recent versions of Emacs may already |
| 343 | have it!) This is the file Misc/python-mode.el; follow the |
| 344 | instructions that came with Emacs for installation of site specific |
| 345 | files. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 346 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 347 | |
| 348 | Configuration options and variables |
| 349 | ----------------------------------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 350 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 351 | Some special cases are handled by passing options to the configure |
| 352 | script. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 353 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 354 | WARNING: if you rerun the configure script with different options, you |
| 355 | must run "make clean" before rebuilding. Exceptions to this rule: |
| 356 | after changing --prefix or --exec-prefix, all you need to do is remove |
Guido van Rossum | b06df27 | 1997-08-05 21:50:20 +0000 | [diff] [blame] | 357 | Modules/getpath.o. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 358 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 359 | --with(out)-gcc: The configure script uses gcc (the GNU C compiler) if |
| 360 | it finds it. If you don't want this, or if this compiler is |
| 361 | installed but broken on your platform, pass the option |
| 362 | --without-gcc. You can also pass "CC=cc" (or whatever the |
| 363 | name of the proper C compiler is) in the environment, but the |
| 364 | advantage of using --without-gcc is that this option is |
| 365 | remembered by the config.status script for its --recheck |
| 366 | option. |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 367 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 368 | --prefix, --exec-prefix: If you want to install the binaries and the |
| 369 | Python library somewhere else than in /usr/local/{bin,lib}, |
| 370 | you can pass the option --prefix=DIRECTORY; the interpreter |
| 371 | binary will be installed as DIRECTORY/bin/python and the |
| 372 | library files as DIRECTORY/lib/python/*. If you pass |
| 373 | --exec-prefix=DIRECTORY (as well) this overrides the |
| 374 | installation prefix for architecture-dependent files (like the |
| 375 | interpreter binary). Note that --prefix=DIRECTORY also |
| 376 | affects the default module search path (sys.path), when |
| 377 | Modules/config.c is compiled. Passing make the option |
| 378 | prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the |
| 379 | prefix set at configuration time; this may be more convenient |
| 380 | than re-running the configure script if you change your mind |
| 381 | about the install prefix... |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 382 | |
Guido van Rossum | b06df27 | 1997-08-05 21:50:20 +0000 | [diff] [blame] | 383 | --with-readline: This option is no longer supported. To use GNU |
| 384 | readline, enable module "readline" in the Modules/Setup file. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 385 | |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 386 | --with-thread: On most Unix systems, you can now use multiple threads. |
Guido van Rossum | 4462e93 | 1997-01-22 21:00:32 +0000 | [diff] [blame] | 387 | To enable this, pass --with-thread. (--with-threads is an |
| 388 | alias.) If the library required for threads lives in a |
Guido van Rossum | 8d90f9d | 1997-05-22 20:13:25 +0000 | [diff] [blame] | 389 | peculiar place, you can use --with-thread=DIRECTORY. NOTE: |
| 390 | you must also enable the thread module by uncommenting it in |
| 391 | the Modules/Setup file. (Threads aren't enabled automatically |
| 392 | because there are run-time penalties when support for them is |
| 393 | compiled in even if you don't use them.) IMPORTANT: run "make |
| 394 | clean" after changing (either enabling or disabling) this |
| 395 | option! Note: for DEC Unix use --with-dec-threads instead. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 396 | |
| 397 | --with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is |
| 398 | supported by the "dl" library by Jack Jansen, which is |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 399 | ftp'able from ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 400 | This is enabled (after you've ftp'ed and compiled the dl |
| 401 | library!) by passing --with-sgi-dl=DIRECTORY where DIRECTORY |
| 402 | is the absolute pathname of the dl library. (Don't bother on |
| 403 | IRIX 5, it already has dynamic linking using SunOS style |
| 404 | shared libraries.) Support for this feature is deprecated. |
| 405 | |
| 406 | --with-dl-dld: Dynamic loading of modules is rumoured to be supported |
| 407 | on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent |
| 408 | Symmetry (Dynix), and Atari ST. This is done using a |
| 409 | combination of the GNU dynamic loading package |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 410 | (ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z) and an |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 411 | emulation of the SGI dl library mentioned above (the emulation |
| 412 | can be found at |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 413 | ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z). To |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 414 | enable this, ftp and compile both libraries, then call the |
| 415 | configure passing it the option |
| 416 | --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is |
| 417 | the absolute pathname of the dl emulation library and |
| 418 | DLD_DIRECTORY is the absolute pathname of the GNU dld library. |
| 419 | (Don't bother on SunOS 4 or 5, they already have dynamic |
| 420 | linking using shared libraries.) Support for this feature is |
| 421 | deprecated. |
| 422 | |
| 423 | --with-libm, --with-libc: It is possible to specify alternative |
| 424 | versions for the Math library (default -lm) and the C library |
| 425 | (default the empty string) using the options |
| 426 | --with-libm=STRING and --with-libc=STRING, respectively. E.g. |
| 427 | if your system requires that you pass -lc_s to the C compiler |
| 428 | to use the shared C library, you can pass --with-libc=-lc_s. |
| 429 | These libraries are passed after all other libraries, the C |
| 430 | library last. |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 431 | |
| 432 | --with-next-archs='arch1 arch2': Under NEXTSTEP, this will build |
| 433 | all compiled binaries with the architectures listed. Includes |
| 434 | correctly setting the target architecture specific resource |
Guido van Rossum | cc55c2d | 1996-10-21 15:14:27 +0000 | [diff] [blame] | 435 | directory. (This option is not supported on other platforms.) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 436 | |
Guido van Rossum | d02ba45 | 1996-07-31 17:36:01 +0000 | [diff] [blame] | 437 | --with-libs='libs': Add 'libs' to the LIBS that the python |
| 438 | linked against. |
| 439 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 440 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 441 | Building for multiple architectures (using the VPATH feature) |
| 442 | ------------------------------------------------------------- |
| 443 | |
| 444 | If your file system is shared between multiple architectures, it |
| 445 | usually is not necessary to make copies of the sources for each |
| 446 | architecture you want to support. If the make program supports the |
| 447 | VPATH feature, you can create an empty build directory for each |
| 448 | architecture, and in each directory run the configure script (on the |
| 449 | appropriate machine with the appropriate options). This creates the |
| 450 | necessary subdirectories and the Makefiles therein. The Makefiles |
| 451 | contain a line VPATH=... which points to directory containing the |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 452 | actual sources. (On SGI systems, use "smake -J1" instead of "make" if |
| 453 | you use VPATH -- don't try gnumake.) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 454 | |
| 455 | For example, the following is all you need to build a minimal Python |
| 456 | in /usr/tmp/python (assuming ~guido/src/python is the toplevel |
| 457 | directory and you want to build in /usr/tmp/python): |
| 458 | |
| 459 | $ mkdir /usr/tmp/python |
| 460 | $ cd /usr/tmp/python |
| 461 | $ ~guido/src/python/configure |
| 462 | [...] |
| 463 | $ make |
| 464 | [...] |
| 465 | $ |
| 466 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 467 | Note that Modules/Makefile copies the original Setup file to the build |
| 468 | directory if it finds no Setup file there. This means that you can |
| 469 | edit the Setup file for each architecture independently. For this |
| 470 | reason, subsequent changes to the original Setup file are not tracked |
| 471 | automatically, as they might overwrite local changes. To force a copy |
| 472 | of a changed original Setup file, delete the target Setup file. (The |
| 473 | makesetup script supports multiple input files, so if you want to be |
| 474 | fancy you can change the rules to create an empty Setup.local if it |
| 475 | doesn't exist and run it with arguments $(srcdir)/Setup Setup.local; |
| 476 | however this assumes that you only need to add modules.) |
| 477 | |
| 478 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 479 | Building on non-UNIX systems |
| 480 | ---------------------------- |
| 481 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 482 | Building Python for a PC is now a piece of cake! |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 483 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 484 | Enter the directory "PC" and read the file "readme.txt". Most popular |
| 485 | non-Unix PC platforms and compilers are supported (Unix ports to the |
| 486 | PC such as Linux, FreeBSD or Solaris-x86 of course use the standard |
| 487 | Unix build instructions). |
| 488 | |
| 489 | For the Mac, a separate source distribution will be made available, |
| 490 | for use with the CodeWarrior compiler. If you are interested in Mac |
| 491 | development, join the PythonMac Special Interest Group |
| 492 | (http://www.python.org/sigs/pythonmac-sig/, or send email to |
| 493 | pythonmac-sig-request@python.org). |
| 494 | |
| 495 | Of course, there are also binary distributions available for these |
| 496 | platforms -- see http://www.python.org/python/. |
| 497 | |
| 498 | To port Python to a new non-UNIX system, you will have to fake the |
| 499 | effect of running the configure script manually (for Mac and PC, this |
| 500 | has already been done for you). A good start is to copy the file |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 501 | config.h.in to config.h and edit the latter to reflect the actual |
| 502 | configuration of your system. Most symbols must simply be defined as |
| 503 | 1 only if the corresponding feature is present and can be left alone |
| 504 | otherwise; however RETSIGTYPE must always be defined, either as int or |
| 505 | as void, and the *_t type symbols must be defined as some variant of |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 506 | int if they need to be defined at all. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 507 | |
| 508 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 509 | |
| 510 | Miscellaneous issues |
| 511 | ==================== |
| 512 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 513 | Documentation |
| 514 | ------------- |
| 515 | |
| 516 | All documentation is provided in the subdirectory Doc in the form of |
| 517 | LaTeX files. In order of importance for new users: Tutorial (tut), |
| 518 | Library Reference (lib), Language Reference (ref), Extending (ext). |
| 519 | Especially the Library Reference is of immense value since much of |
| 520 | Python's power (including the built-in data types and functions!) is |
| 521 | described here. |
| 522 | |
Guido van Rossum | dfcf35d | 1996-08-26 17:52:09 +0000 | [diff] [blame] | 523 | To print the documentation from the LaTeX files, chdir into the Doc |
| 524 | subdirectory, type "make" (let's hope you have LaTeX installed!), and |
| 525 | send the four resulting PostScript files (tut.ps, lib.ps, ref.ps, and |
| 526 | ext.ps) to the printer. See the README file there. If you don't have |
| 527 | LaTeX, you can ftp the PostScript files from the ftp archives (see |
| 528 | below). |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 529 | |
Guido van Rossum | dfcf35d | 1996-08-26 17:52:09 +0000 | [diff] [blame] | 530 | All documentation is also available on-line via the Python web site |
| 531 | (http://www.python.org/, see below). It can also be downloaded |
| 532 | separately from the ftp archives (see below) in Emacs INFO, HTML or |
| 533 | PostScript form -- see the web site or the FAQ (file Misc/FAQ) for |
| 534 | more info. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 535 | |
| 536 | |
| 537 | Emacs mode |
| 538 | ---------- |
| 539 | |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 540 | There's an excellent Emacs editing mode for Python code; see the file |
| 541 | Misc/python-mode.el. Originally written by Tim Peters, it is now |
| 542 | maintained by Barry Warsaw <bwarsaw@cnri.reston.va.us>. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 543 | |
| 544 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 545 | Web site |
| 546 | -------- |
| 547 | |
| 548 | Python's own web site has URL http://www.python.org/. Come visit us! |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 549 | There are a number of mirrors, listed on the home page -- try a mirror |
| 550 | that's close you you. |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 551 | |
| 552 | |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 553 | Ftp site |
| 554 | -------- |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 555 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 556 | Python's own ftp site is ftp.python.org, directory /pub/python. See |
| 557 | the FAQ (file Misc/FAQ) for a list of other ftp sites carrying the |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 558 | Python distribution. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 559 | |
| 560 | |
| 561 | Newsgroup and mailing list |
| 562 | -------------------------- |
| 563 | |
Guido van Rossum | dfcf35d | 1996-08-26 17:52:09 +0000 | [diff] [blame] | 564 | There are a newsgroup and a mailing list devoted to Python. The |
| 565 | newsgroup, comp.lang.python, contains exactly the same messages as the |
| 566 | mailing list (though not always in the same order, due to the |
| 567 | mysterious nature of the Usenet news distribution algorithm). To |
| 568 | subscribe to the mailing list, send mail containing your real name and |
| 569 | e-mail address to "python-list-request@cwi.nl". Use the same address |
| 570 | if you want to unsibscribed. (A real person reads these messages, so |
| 571 | no LISTPROC or Majordomo commands, please, and please be patient -- |
| 572 | normal turn-around time is about one working day.) |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 573 | |
Guido van Rossum | dfcf35d | 1996-08-26 17:52:09 +0000 | [diff] [blame] | 574 | The Python web site contains a search form that lets you search the |
| 575 | newsgroup archives (or the web site itself). Click on the "search" |
| 576 | link in the banner menu on any page of http://www.python.org/. |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 577 | |
| 578 | |
| 579 | Bug reports |
| 580 | ----------- |
| 581 | |
Guido van Rossum | dfcf35d | 1996-08-26 17:52:09 +0000 | [diff] [blame] | 582 | Bugs are best reported to the comp.lang.python newsgroup or the Python |
Guido van Rossum | cc55c2d | 1996-10-21 15:14:27 +0000 | [diff] [blame] | 583 | mailing list -- see the section "Newsgroup and mailing list" above. |
Guido van Rossum | dfcf35d | 1996-08-26 17:52:09 +0000 | [diff] [blame] | 584 | Before posting, check the newsgroup archives (see above) to see if |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 585 | your bug has already been reported! |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 586 | |
| 587 | |
| 588 | Questions |
| 589 | --------- |
| 590 | |
| 591 | For help, if you can't find it in the manuals, the FAQ or on the web |
| 592 | site, it's best to post to the comp.lang.python or the Python mailing |
| 593 | list (see above). If you specifically don't want to involve the |
| 594 | newsgroup or mailing list, send questions to python-help@python.org. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 595 | |
| 596 | |
| 597 | The Tk interface |
| 598 | ---------------- |
| 599 | |
| 600 | Tk (the user interface component of John Ousterhout's Tcl language) is |
| 601 | also usable from Python. Since this requires that you first build and |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 602 | install Tcl/Tk, the Tk interface is not enabled by default. It works |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 603 | with Tcl 7.5 and Tk 4.1 as well as with Tcl 7.4 and Tk 4.0. I didn't |
| 604 | have the time to test it with Tcl 7.6 and Tk 4.2 yet, but it might |
| 605 | well work. |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 606 | |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 607 | See http://www.sunlabs.com/research/tcl/ for more info on where to get |
Guido van Rossum | 33fde57 | 1997-05-09 02:40:09 +0000 | [diff] [blame] | 608 | Tcl/Tk. Also http://sunscript.sun.com/. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 609 | |
| 610 | To enable the Python/Tk interface, once you've built and installed |
| 611 | Tcl/Tk, all you need to do is edit two lines in Modules/Setup; search |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 612 | for the string "_tkinter". Uncomment one (normally the first) of the |
| 613 | lines beginning with "#_tkinter" and un-comment the line beginning |
| 614 | with "#TKPATH". If you have installed Tcl/Tk or X11 in unusual |
| 615 | places, you will have to edit the first line to fix or add -I and -L |
| 616 | options. See the Build Instructions above for more details. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 617 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 618 | There is little documentation on how to use Tkinter; however most of |
| 619 | the Tk manual pages apply quite straightforwardly. Begin with |
| 620 | fetching the "Tk Lifesaver" document, |
| 621 | e.g. ftp://ftp.python.org/pub/python/doc/tkinter-doc.tar.gz (a gzipped |
| 622 | tar file containing a PostScript file) or the on-line version |
| 623 | http://www.python.org/doc/life-preserver/index.html. Reading the |
| 624 | Tkinter.py source will reveal most details on how Tkinter calls are |
| 625 | translated into Tcl code. |
| 626 | |
| 627 | There are demos in the Demo/tkinter directory, in the subdirectories |
| 628 | guido, matt and www (the matt and guido subdirectories have been |
| 629 | overhauled to use more recent Tkinter coding conventions). |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 630 | |
| 631 | Note that there's a Python module called "Tkinter" (capital T) which |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 632 | lives in Lib/tkinter/Tkinter.py, and a C module called "_tkinter" |
| 633 | (lower case t and leading underscore) which lives in |
| 634 | Modules/_tkinter.c. Demos and normal Tk applications only import the |
| 635 | Python Tkinter module -- only the latter uses the C _tkinter module |
| 636 | directly. In order to find the C _tkinter module, it must be compiled |
| 637 | and linked into the Python interpreter -- the _tkinter line in the |
| 638 | Setup file does this. In order to find the Python Tkinter module, |
| 639 | sys.path must be set correctly -- the TKPATH assignment in the Setup |
| 640 | file takes care of this, but only if you install Python properly |
| 641 | ("make install libinstall"). (You can also use dynamic loading for |
| 642 | the C _tkinter module, in which case you must manually fix up sys.path |
| 643 | or set $PYTHONPATH for the Python Tkinter module.) |
Guido van Rossum | 84c8c7f | 1995-08-28 02:44:24 +0000 | [diff] [blame] | 644 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 645 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 646 | Distribution structure |
| 647 | ---------------------- |
| 648 | |
| 649 | Most subdirectories have their own README file. Most files have |
| 650 | comments. |
| 651 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 652 | BUGS A list of known bugs (not completely up-to-date) |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 653 | Demo/ Demonstration scripts, modules and programs |
| 654 | Doc/ Documentation (LaTeX sources) |
| 655 | Grammar/ Input for the parser generator |
| 656 | Include/ Public header files |
| 657 | Lib/ Python library modules |
| 658 | Makefile.in Source from which config.status creates Makefile |
| 659 | Misc/ Miscellaneous files |
| 660 | Modules/ Implementation of most built-in modules |
| 661 | Objects/ Implementation of most built-in object types |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 662 | PC/ PC porting files (DOS, Windows, NT, OS/2) |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 663 | Parser/ The parser and tokenizer and their input handling |
| 664 | Python/ The "compiler" and interpreter |
| 665 | README The file you're reading now |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 666 | TODO A list of things that could be done (not up-to-date) |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 667 | Tools/ Some useful programs written in Python |
| 668 | acconfig.h Additional input for the autoheader program |
| 669 | config.h.in Source from which config.status creates config.h |
| 670 | configure Configuration shell script (GNU autoconf output) |
| 671 | configure.in Configuration specification (GNU autoconf input) |
| 672 | install-sh Shell script used to install files |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 673 | |
| 674 | The following files will (may) be created in the toplevel directory by |
| 675 | the configuration and build processes: |
| 676 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 677 | Makefile Build rules |
| 678 | config.cache cache of configuration variables |
| 679 | config.h Configuration header |
| 680 | config.log log from last configure run |
| 681 | config.status status from last run of configure script |
| 682 | python The executable interpreter |
| 683 | tags, TAGS Tags files for vi and Emacs |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 684 | |
| 685 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 686 | Author's address |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 687 | ================ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 688 | |
| 689 | Guido van Rossum |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 690 | CNRI |
| 691 | 1895 Preston White Drive |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 692 | Reston, VA 20191 |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 693 | USA |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 694 | |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 695 | E-mail: guido@cnri.reston.va.us or guido@python.org |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 696 | |
| 697 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 698 | |
| 699 | Copyright notice |
| 700 | ================ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 701 | |
| 702 | The Python source is copyrighted, but you can freely use and copy it |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 703 | as long as you don't change or remove the copyright notice: |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 704 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 705 | ---------------------------------------------------------------------- |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 706 | Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
| 707 | The Netherlands. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 708 | |
| 709 | All Rights Reserved |
| 710 | |
Guido van Rossum | c561e5d | 1994-08-23 13:52:46 +0000 | [diff] [blame] | 711 | Permission to use, copy, modify, and distribute this software and its |
| 712 | documentation for any purpose and without fee is hereby granted, |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 713 | provided that the above copyright notice appear in all copies and that |
Guido van Rossum | c561e5d | 1994-08-23 13:52:46 +0000 | [diff] [blame] | 714 | both that copyright notice and this permission notice appear in |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 715 | supporting documentation, and that the names of Stichting Mathematisch |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 716 | Centrum or CWI or Corporation for National Research Initiatives or |
| 717 | CNRI not be used in advertising or publicity pertaining to |
| 718 | distribution of the software without specific, written prior |
| 719 | permission. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 720 | |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 721 | While CWI is the initial source for this software, a modified version |
| 722 | is made available by the Corporation for National Research Initiatives |
| 723 | (CNRI) at the Internet address ftp://ftp.python.org. |
| 724 | |
| 725 | STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH |
| 726 | REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF |
| 727 | MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH |
| 728 | CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL |
| 729 | DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 730 | PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 731 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 732 | PERFORMANCE OF THIS SOFTWARE. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 733 | ---------------------------------------------------------------------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 734 | |
| 735 | |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 736 | --Guido van Rossum (home page: http://www.python.org/~guido/) |