blob: a85ac9c531dda9ee9c5303898c739b99e590f8bd [file] [log] [blame]
Guido van Rossuma7925f11994-01-26 10:20:16 +00001Subject: FAQ: Python -- an object-oriented language
2Newsgroups: comp.lang.misc,comp.answers,news.answers
3Followup-to: comp.lang.misc
4From: guido@cwi.nl (Guido van Rossum)
5Reply-to: guido@cwi.nl (Guido van Rossum)
6Approved: news-answers-request@MIT.Edu
7
8Archive-name: python-faq/part1
Guido van Rossum95f61a71994-01-26 17:23:37 +00009Version: 1.3
10Last-modified: 26 Jan 1994
Guido van Rossuma7925f11994-01-26 10:20:16 +000011
12This article contains answers to Frequently Asked Questions about
13Python (an object-oriented interpreted programming language -- see
14the answer to question 1.1 for a short overview).
15
16Copyright 1993, 1994 Guido van Rossum. Unchanged electronic
17redistribution of this FAQ is allowed. Printed redistribution only
18with permission of the author. No warranties.
19
20Author's address:
21 Guido van Rossum
22 CWI, dept. CST
23 Kruislaan 413
24 P.O. Box 94079
25 1090 GB Amsterdam
26 The Netherlands
27Email: guido@cwi.nl
28
29The latest version of this FAQ is available by anonymous ftp from
30ftp.cwi.nl [192.16.184.180] in the directory /pub/python, with
31filename python-FAQ. It will also be posted regularly to the
32newsgroups comp.answers and comp.lang.misc.
33
34Many FAQs, including this one, are available by anonymous ftp from
35rtfm.mit.edu [18.70.0.209] in the directory pub/usenet/news.answers.
36The name under which a FAQ is archived appears in the Archive-name line
37at the top of the article. This FAQ is archived as python-faq/part1.
38
39There's a mail server on that machine which will send you files from
40the archive by e-mail if you have no ftp access. You send a e-mail
41message to mail-server@rtfm.mit.edu containing the single word help in
42the message body to receive instructions.
43
44This FAQ is divided in the following chapters:
45
46 1. General information and availability
47 2. Python in the real world
48 3. Building Python
49 4. Programming in Python
50 5. Extending Python
51 6. Python's design
52 7. Using Python on non-UNIX platforms
53
54To find the start of a particular chapter, search for the chapter number
55followed by a dot and a space at the beginning of a line (e.g. to
56find chapter 4 in vi, type /^4\. /).
57
58Here's an overview of the questions per chapter:
59
60 1. General information and availability
61 1.1. Q. What is Python?
62 1.2. Q. Why is it called Python?
63 1.3. Q. How do I obtain a copy of the Python source?
64 1.4. Q. How do I get documentation on Python?
65 1.5. Q. Is there a newsgroup or mailing list devoted to Python?
66 1.6. Q. Is there a book on Python, or will there be one out soon?
67 1.7. Q. Are there any published articles about Python that I can quote?
Guido van Rossum95f61a71994-01-26 17:23:37 +000068 1.8. Q. How does the Python version numbering scheme work?
Guido van Rossuma7925f11994-01-26 10:20:16 +000069
70 2. Python in the real world
71 2.1. Q. How many people are using Python?
72 2.2. Q. Have any significant projects been done in Python?
73 2.3. Q. Are there any commercial projects going on using Python?
Guido van Rossum95f61a71994-01-26 17:23:37 +000074 2.4. Q. How stable is Python?
75 2.5. Q. What new developments are expected for Python in the future?
Guido van Rossuma7925f11994-01-26 10:20:16 +000076
77 3. Building Python
78 3.1. Q. I have trouble building the md5 module and/or finding the file
79 md5.c.
80 3.2. Q. Is there a test set?
81 3.3. Q. When running the test set, I get complaints about floating point
82 operations, but when playing with floating point operations I cannot
83 find anything wrong with them.
84 3.4. Q. I get an OverflowError on evaluating 2*2. What is going on?
Guido van Rossum95f61a71994-01-26 17:23:37 +000085 3.5. Q. Trouble building Python 0.9.9 or earlier on platform X.
86 3.6. Q. Trouble building Python 1.0.0 on platform X.
Guido van Rossuma7925f11994-01-26 10:20:16 +000087
88 4. Programming in Python
89 4.1. Q. Can I create an object class with some methods implemented in
90 C and others in Python (e.g. through inheritance)? (Also phrased as:
91 Can I use a built-in type as base class?)
92 4.2. Q. I assign to a variable in a call to exec() but when I try to
93 use it on the next line I get an error. What is going on?
94 4.3. Q. Why does that work?
95 4.4. Q. Is there a curses/termcap package for Python?
96 4.5. Q. Is there an equivalent to C's onexit() in Python?
97 4.6. Q. When I define a function nested inside another function, the
98 nested function seemingly can't access the local variables of the
99 outer function. What is going on? How do I pass local data to a
100 nested function?
101 4.7. Q. How do I iterate over a sequence in reverse order?
102 4.8. Q. My program is too slow. How do I speed it up?
103 4.9. Q. When I have imported a module, then edit it, and import it
104 again (into the same Python process), the changes don't seem to take
105 place. What is going on?
106
107 5. Extending Python
108 5.1. Q. Can I create my own functions in C?
109 5.2. Q. Can I create my own functions in C++?
110
111 6. Python's design
112 6.1. Q. Why isn't there a generic copying operation for objects in
113 Python?
114 6.2. Q. Why isn't there a generic way to implement persistent objects
115 in Python? (Persistent == automatically saved to and restored from
116 disk.)
117 6.3. Q. Why isn't there a switch or case statement in Python?
118
119 7. Using Python on non-UNIX platforms
Guido van Rossum95f61a71994-01-26 17:23:37 +0000120 7.1. Q. Where's the DOS version of 1.0.0?
Guido van Rossuma7925f11994-01-26 10:20:16 +0000121 7.2. Q. Is there a Windows version of Python?
122 7.3. Q. I have the Mac or DOS version but it appears to be only a binary.
123 Where's the library?
124 7.4. Q. Where's the documentation for the Mac or DOS version?
125 7.5. Q. The Mac version doesn't seem to have any facilities for creating or
126 editing programs apart from entering it interactively, and there seems
127 to be no way to save code that was entered interactively. How do I
128 create a Python program on the Mac?
129
130To find a particular question, search for the question number followed
131by a dot, a space, and a Q at the beginning of a line (e.g. to find
132question 4.2 in vi, type /^4\.2\. Q/).
133
134
1351. General information and availability
136=======================================
137
1381.1. Q. What is Python?
139
140A. Python is an interpreted, interactive, object-oriented programming
141language. It incorporates modules, exceptions, dynamic typing, very
142high level dynamic data types, and classes. Python combines
143remarkable power with very clear syntax. It has interfaces to many
144system calls and libraries, as well as to various window systems, and
145is extensible in C or C++. It is also usable as an extension language
146for applications that need a programmable interface. Finally, Python
147is portable: it runs on many brands of UNIX, on the Mac, and on
148MS-DOS.
149
150To find out more, the best thing to do is to start reading the
151tutorial from the documentation set (see a few questions further
152down).
153
1541.2. Q. Why is it called Python?
155
156A. Apart from being a computer wizard, I'm also a fan of "Monty
157Python's Flying Circus" (a BBC comedy series from the seventies, in
158case you didn't know). It occurred to me one day that I needed a name
159that was short, unique, and slightly mysterious. And I happened to be
160reading some scripts from the series at the time... So then I decided
161to call my language Python. But Python is not a joke. And don't you
162associate it with dangerous reptiles either!
163
1641.3. Q. How do I obtain a copy of the Python source?
165
166A. The latest Python source distribution is always available by
167anonymous ftp from ftp.cwi.nl [192.16.184.180] in the directory
168/pub/python, with filename python<version>.tar.Z. It is a compressed
169tar file containing the complete C source, LaTeX documentation, Python
170library modules, example programs, and several useful pieces of freely
171distributable software. This will compile and run out of the box on
Guido van Rossum95f61a71994-01-26 17:23:37 +0000172most UNIX platforms. Currently <version> is 1.0.0. (See section 7
Guido van Rossuma7925f11994-01-26 10:20:16 +0000173for non-UNIX information.)
174
1751.4. Q. How do I get documentation on Python?
176
177A. The latest Python documentation set is always available by
178anonymous ftp from ftp.cwi.nl [192.16.184.180] in the directory
179/pub/python, with filename pythondoc-ps<version>.tar.Z. It is a
180compressed tar file containing PostScript files of the reference
181manual, the library manual, and the tutorial. Currently <version> is
Guido van Rossum95f61a71994-01-26 17:23:37 +00001821.0.0. (Note that the library manual is the most important one of the
Guido van Rossuma7925f11994-01-26 10:20:16 +0000183set, as much of Python's power stems from the standard or built-in
184types, functions and modules, all of which are described here.)
185PostScript for a high-level description of Python is in the file
186nluug-paper.ps.
187
188The following sites keep mirrors of the Python distribution:
189
190Site IP address Directory
191
192gatekeeper.dec.com 16.1.0.2 /pub/plan/python/cwi
193ftp.uu.net 192.48.96.9 /languages/python
194ftp.wustl.edu 128.252.135.4 /graphics/graphics/sgi-stuff/python
195ftp.funet.fi 128.214.6.100 /pub/languages/python (old?)
196ftp.fu-berlin.de 130.133.4.50 /pub/unix/languages/python (python* only)
197
Guido van Rossum95f61a71994-01-26 17:23:37 +0000198Or try archie on e.g. python1.0.0.tar.Z to locate the nearest copy of
Guido van Rossuma7925f11994-01-26 10:20:16 +0000199that version...
200
2011.5. Q. Is there a newsgroup or mailing list devoted to Python?
202
203A. There is no Python newsgroup yet; if you want to post to the net
204about Python, use comp.lang.misc. There is a mailing list devoted to
205Python; send e-mail to python-list-request@cwi.nl to (un)subscribe.
206There are plans to start the discussion about creation of
207comp.lang.python as soon as version 1.0.0 has been released.
208
2091.6. Q. Is there a book on Python, or will there be one out soon?
210
211A. Unfortunately, not yet. I would like to write one but my
212obligations at CWI include too much other work to make much progress
213on it. Several parties have expressed interest in sponsoring or
214helping the production of a book or reference manual, but so far there
215are no firm plans. If you volunteer help, by all means drop me a
216note!
217
2181.7. Q. Are there any published articles about Python that I can quote?
219
220A. So far the only refereed and published article that describes
221Python in some detail is:
222
223 Guido van Rossum and Jelke de Boer, "Interactively Testing Remote
224 Servers Using the Python Programming Language", CWI Quarterly, Volume
225 4, Issue 4 (December 1991), Amsterdam, pp 283-303.
226
227LaTeX source for this paper is available as part of the Python source
228distribution.
229
230A more recent high-level description of Python is:
231
232 Guido van Rossum, "An Introduction to Python for UNIX/C
233 Programmers", in the proceedings of the NLUUG najaarsconferentie
234 1993 (dutch UNIX users group meeting november 1993).
235
236PostScript for this paper and for the slides used for the accompanying
237presentation can be found in the ftp directory mentioned a few
238questions earlier, with filenames nluug-paper.ps and nluug-slides.ps,
239respectively.
240
Guido van Rossum95f61a71994-01-26 17:23:37 +00002411.8. Q. How does the Python version numbering scheme work?
242
243A. Python versions are numbered A.B.C. A is the major version number
244-- it is only incremented for major changes in functionality or source
245structure. B is the minor version number, incremented for less
246earth-shattering changes to a release. C is the patchlevel -- it is
247incremented for each new release. Note that in the past, patches have
248added significant changes; in fact the changeover from 0.9.9 to 1.0.0
249was the first time that either A or B changed!
250
Guido van Rossuma7925f11994-01-26 10:20:16 +0000251
2522. Python in the real world
253===========================
254
2552.1. Q. How many people are using Python?
256
257A. I don't know, but at the last count there were at least 130
258addresses on the Python mailing list (several of which are local
259redistribution lists). I suspect that many users don't bother
260to subscribe to the list.
261
2622.2. Q. Have any significant projects been done in Python?
263
264A. Here at CWI (the home of Python), we have written a 20,000 line
265authoring environment for transportable hypermedia presentations, a
266multimedia teleconferencing tool, as well as many smaller programs.
267
268The University of Virginia uses Python to control a virtual reality
269engine. Contact: Matt Conway <conway@virginia.edu>.
270
271See also the next question.
272
2732.3. Q. Are there any commercial projects going on using Python?
274
275A. Several companies have revealed to me that they are planning or
276considering to use Python in a future product. The furthest is
277Sunrise Software, who already have a product out using Python -- they
278use Python for a GUI management application and an SNMP network
279manangement application. Contact: <info@sunrise.com>.
280
281Individuals at many other companies are using Python for
282internal development (witness their contributions to the Python
283mailing list).
284
285Python has also been elected as an extension language by MADE, a
286consortium supported by the European Committee's ESPRIT program and
287consisting of Bull, CWI and some other European companies. Contact:
288Ivan Herman <ivan@cwi.nl>.
289
Guido van Rossum95f61a71994-01-26 17:23:37 +00002902.4. Q. How stable is Python?
Guido van Rossuma7925f11994-01-26 10:20:16 +0000291
Guido van Rossum95f61a71994-01-26 17:23:37 +0000292A. Very stable. While the current version number (1.0.0) would
Guido van Rossuma7925f11994-01-26 10:20:16 +0000293suggest it is in the early stages of development, in fact new, stable
Guido van Rossum95f61a71994-01-26 17:23:37 +0000294releases (numbered 0.9.x) have been coming out roughly every 3 to 6
295months for the past four years.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000296
Guido van Rossum95f61a71994-01-26 17:23:37 +00002972.5. Q. What new developments are expected for Python in the future?
Guido van Rossuma7925f11994-01-26 10:20:16 +0000298
Guido van Rossum95f61a71994-01-26 17:23:37 +0000299A. Without warranty that any of this will actually be realized: I am
Guido van Rossuma7925f11994-01-26 10:20:16 +0000300currently thinking about mechanisms for built-in on-line help and a
Guido van Rossum95f61a71994-01-26 17:23:37 +0000301switch/case statement. A pthreads interface has been contributed
302which I would like to merge into the latest release. The X interface
303needs improving. There are also some people (independently) working
304on a windowing interface based on STDWIN but with the power and ease
305of use of the average modern widget set. I still hope to get some
306help in producing a Windows version. It would be nice if there were a
307window-based class browser (Someone at CWI has contributed one using
308Motif but it needs some work). Also: improved support for embedding
309Python in other applications, e.g. by renaming most global symbols to
310have a "Py" prefix and providing more documentation and threading
311support.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000312
313
3143. Building Python
315==================
316
3173.1. Q. I have trouble building the md5 module and/or finding the file
318md5.c.
319
320A. Apparently the md5 module was based on an older version of RSA's
321md5 implementation. The ftp site rsa.com mentioned in the Makefile
322where this version was found is no longer accessible, and the version
323from RFC 1321 (md5c.c) is slightly different. This will be fixed in
324the 1.0 release; write me if you need the fixes now.
325
3263.2. Q. Is there a test set?
327
328A. Yes, simply do "import testall" (or "import autotest" if you aren't
329interested in the output). The standard modules whose name begins
330with "test" together comprise the test. The test set doesn't test
331*all* features of Python but it goes a long way to confirm that a new
332port is actually working. The Makefile contains an entry "make test"
333which runs the autotest module.
334
3353.3. Q. When running the test set, I get complaints about floating point
336operations, but when playing with floating point operations I cannot
337find anything wrong with them.
338
339A. The test set makes occasional unwarranted assumptions about the
340semantics of C floating point operations. Until someone donates a
341better floating point test set, you will have to comment out the
342offending floating point tests and execute similar tests manually.
343
3443.4. Q. I get an OverflowError on evaluating 2*2. What is going on?
345
346A. Your machine probably has 64 bit long integers (e.g. DEC alpha or
347HP snake architectures). There are some dependencies on word length
348in file intobject.c. This will be corrected in the 1.0 release; until
349then, on a 64 bit machine, just comment out the check for overflow
350from int_mul:
351
352 #if 0
353 if (x > 0x7fffffff || x < (double) (long) 0x80000000)
354 return err_ovf("integer multiplication");
355 #endif
356
357You should also include <limits.h> and replace the constant 32 by
358LONG_BIT in int_[lr]shift.
359
Guido van Rossum95f61a71994-01-26 17:23:37 +00003603.5. Q. Trouble building Python 0.9.9 or earlier on platform X.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000361
Guido van Rossum95f61a71994-01-26 17:23:37 +0000362Please convert to Python 1.0.0 -- it is much more portable.
363
3643.6. Q. Trouble building Python 1.0.0 on platform X.
365
366A. Please email the details to <guido@cwi.nl> and I'll look into it.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000367
368
3694. Programming in Python
370========================
371
3724.1. Q. Can I create an object class with some methods implemented in
373C and others in Python (e.g. through inheritance)? (Also phrased as:
374Can I use a built-in type as base class?)
375
376A. No, but you can easily create a Python class which serves as a
377wrapper around a built-in object, e.g. (for dictionaries):
378
379 # A user-defined class behaving almost identical
380 # to a built-in dictionary.
381 class UserDict:
382 def __init__(self): self.data = {}
383 def __repr__(self): return repr(self.data)
384 def __cmp__(self, dict):
385 if type(dict) == type(self.data):
386 return cmp(self.data, dict)
387 else:
388 return cmp(self.data, dict.data)
389 def __len__(self): return len(self.data)
390 def __getitem__(self, key): return self.data[key]
391 def __setitem__(self, key, item): self.data[key] = item
392 def __delitem__(self, key): del self.data[key]
393 def keys(self): return self.data.keys()
394 def items(self): return self.data.items()
395 def values(self): return self.data.values()
396 def has_key(self, key): return self.data.has_key(key)
397
3984.2. Q. I assign to a variable in a call to exec() but when I try to
399use it on the next line I get an error. What is going on?
400
401A. The reason why this occurs is too complicated to explain (but see
402the next question). To fix it is easy, however: simply assign None to
403the variable *before* calling exec(). This will be fixed in the 1.0
404release.
405
4064.3. Q. Why does that work?
407
408A. When parsing your program and converting it into internal pseudo
409code, the interpreter does some optimizations to speed up function
410execution: it figures out the names of all the local variables and
411treats them specially. Because your assignment is done by exec(), it
412is not seen initially by the parser and the variable is not recognized
413as a local variable. The default treatment is as a global variable,
414but the exec() statement places it in the local scope, where it is not
415found. This will be fixed in release 1.0 by making exec into a
416statement; the parser will then be able to switch off the
417optimizations for local variables if it encounters an exec statement
418(recognizing calls to built-in functions is not possible for the
419parser, hence the syntax change to a statement).
420
4214.4. Q. Is there a curses/termcap package for Python?
422
423A. No, but you can use the "alfa" (== character cell) version of
424STDWIN. (STDWIN == Standard Windows, a portable windowing system
425interface by the same author, URL ftp://ftp.cwi.nl/pub/stdwin.)
426This will also prepare your program for porting to windowing
427environments such as X11 or the Macintosh.
428
4294.5. Q. Is there an equivalent to C's onexit() in Python?
430
431A. Yes, if you import sys and assign a function to sys.exitfunc, it
432will be called when your program exits, is killed by an unhandled
433exception, or (on UNIX) receives a SIGHUP or SIGTERM signal.
434
4354.6. Q. When I define a function nested inside another function, the
436nested function seemingly can't access the local variables of the
437outer function. What is going on? How do I pass local data to a
438nested function?
439
440A. Python does not have arbitrarily nested scopes. When you need to
441create a function that needs to access some data which you have
442available locally, create a new class to hold the data and return a
443method of an instance of that class, e.g.:
444
445 class MultiplierClass:
446 def __init__(self, factor):
447 self.factor = factor
448 def multiplier(self, argument):
449 return argument * self.factor
450
451 def generate_multiplier(factor):
452 return MultiplierClass(factor).multiplier
453
454 twice = generate_multiplier(2)
455 print twice(10)
456 # Output: 20
457
4584.7. Q. How do I iterate over a sequence in reverse order?
459
460A. If it is a list, the fastest solution is
461
462 list.reverse()
463 try:
464 for x in list:
465 "do something with x"
466 finally:
467 list.reverse()
468
469This has the disadvantage that while you are in the loop, the list
470is temporarily reversed. If you don't like this, you can make a copy.
471This appears expensive but is actually faster than other solutions:
472
473 rev = list[:]
474 rev.reverse()
475 for x in rev:
476 <do something with x>
477
478If it isn't a list, a more general but slower solution is:
479
480 i = len(list)
481 while i > 0:
482 i = i-1
483 x = list[i]
484 <do something with x>
485
486A more elegant solution, is to define a class which acts as a sequence
487and yields the elements in reverse order (solution due to Steve
488Majewski):
489
490 class Rev:
491 def __init__(self, seq):
492 self.forw = seq
493 def __len__(self):
494 return len(self.forw)
495 def __getitem__(self, i):
496 return self.forw[-(i + 1)]
497
498You can now simply write:
499
500 for x in Rev(list):
501 <do something with x>
502
503Unfortunately, this solution is slowest of all, due the the method
504call overhead...
505
5064.8. Q. My program is too slow. How do I speed it up?
507
508A. That's a tough one, in general. There are many tricks to speed up
509Python code; I would consider rewriting parts in C only as a last
510resort. One thing to notice is that function and (especially) method
511calls are rather expensive; if you have designed a purely OO interface
512with lots of tiny functions that don't do much more than get or set an
513instance variable or call another method, you may consider using a
514more direct way, e.g. directly accessing instance variables. Also see
515the standard module "profile" (described in the file
516"python/lib/profile.doc") which makes it possible to find out where
517your program is spending most of its time (if you have some patience
518-- the profiling itself can slow your program down by an order of
519magnitude).
520
5214.9. Q. When I have imported a module, then edit it, and import it
522again (into the same Python process), the changes don't seem to take
523place. What is going on?
524
525A. For efficiency reasons, Python only reads the module file on the
526first time a module is imported (otherwise a program consisting of
527many modules, each of which imports the same basic module, would read
528the basic module over and over again). To force a changed module
529being read again, do this:
530
531 import modname
532 reload(modname)
533
534Warning: this technique is not 100% fool-proof. In particular,
535modules containing statements like
536
537 from modname import some_objects
538
539will continue to work with the old version of the objects imported
540thus.
541
542
5435. Extending Python
544===================
545
5465.1. Q. Can I create my own functions in C?
547
548A. Yes, you can create built-in modules containing functions,
549variables, exceptions and even new types in C. This is all explained
550in the file "python/misc/EXTENDING". Also read the file "DYNLOAD"
551there for hints on how to load such extension modules
552
5535.2. Q. Can I create my own functions in C++?
554
555A. Yes, using the C-compatibility features found in C++. Basically
556you place extern "C" { ... } around the Python include files and put
557extern "C" before each function that is going to be called by the
558Python interpreter. Global or static C++ objects with constructors
559are probably not a good idea.
560
561
5626. Python's design
563==================
564
5656.1. Q. Why isn't there a generic copying operation for objects in
566Python?
567
568A. Hmm. Maybe there should be one, but it's difficult to assign a
569useful meaning to copying of open files, sockets and windows, or
570recursive data structures. As long as you design all your classes
571yourself you are of course free to define a standard base class that
572defines an overridable copying operation for all the objects you care
573about. (One practical point: it would have to be a built-in function,
574not a standard method name, since not all built-in object types have
575methods; e.g. strings, integers and tuples don't.)
576
5776.2. Q. Why isn't there a generic way to implement persistent objects
578in Python? (Persistent == automatically saved to and restored from
579disk.)
580
581A. Hmm, hmm. Basically for the same reasons as why there is no
582generic copying operation.
583
5846.3. Q. Why isn't there a switch or case statement in Python?
585
586A. You can do this easily enough with a sequence of
587if... elif... elif... else. There have been some proposals for switch
588statement syntax, but there is no concensus (yet) on whether and how
589to do range tests.
590
591
5927. Using Python on non-UNIX platforms
593=====================================
594
Guido van Rossum95f61a71994-01-26 17:23:37 +00005957.1. Q. Where's the DOS version of 1.0.0?
Guido van Rossuma7925f11994-01-26 10:20:16 +0000596
Guido van Rossum95f61a71994-01-26 17:23:37 +0000597A. I hope it will be coming soon. Our institute has finally acquired
598a 486 PC with a decent C compiler, now all I have to do is to learn
599how to use it :-) Until then, you will have to make do with the 0.9.8
600version (which isn't so bad, actually).
Guido van Rossuma7925f11994-01-26 10:20:16 +0000601
6027.2. Q. Is there a Windows version of Python?
603
604A. Not yet. Several Windows hackers with C compilers are working on a
605port though, so maybe we'll have one soon.
606
6077.3. Q. I have the Mac or DOS version but it appears to be only a binary.
608Where's the library?
609
610A. You still need to copy the files from the distribution directory
611"python/lib" to your system. If you don't have the full distribution,
Guido van Rossum95f61a71994-01-26 17:23:37 +0000612you can ftp the file pythonlib1.0.0.tar.Z from site ftp.cwi.nl,
Guido van Rossuma7925f11994-01-26 10:20:16 +0000613directory /pub/python; this is a subset of the distribution containing
614just those file.
615
6167.4. Q. Where's the documentation for the Mac or DOS version?
617
618A. There isn't any. The documentation for the Unix version also
619applies to the Mac and DOS versions. Where applicable, differences
620are indicated in the text.
621
6227.5. Q. The Mac version doesn't seem to have any facilities for creating or
623editing programs apart from entering it interactively, and there seems
624to be no way to save code that was entered interactively. How do I
625create a Python program on the Mac?
626
627A. Use an external editor. I am quite happy with the Desk Accessory
628called Sigma Edit; this doesn't require Multifinder or System 7. I
629work like this: start the interpreter; edit a module file using Sigma
630Edit; import and test it in the interpreter; edit again in Sigma Edit;
631then use the built-in function reload() to re-read the imported
632module; etc.