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