-
Notifications
You must be signed in to change notification settings - Fork 0
/
FAQ.html
8997 lines (8215 loc) · 352 KB
/
FAQ.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<HTML>
<HEAD>
<TITLE>The Whole Python FAQ</TITLE>
</HEAD>
<BODY BACKGROUND="http://www.python.org/pics/RedShort.gif"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#AA0000"
VLINK="#906A6A">
<H1>The Whole Python FAQ</H1>
Last changed on Wed Feb 12 21:31:08 2003 CET
<P>(Entries marked with ** were changed within the last 24 hours;
entries marked with * were changed within the last 7 days.)
<P>
<P>
<HR>
<H2>1. General information and availability</H2>
<UL>
<LI><A HREF="#1.1">1.1. What is Python?</A>
<LI><A HREF="#1.2">1.2. Why is it called Python?</A>
<LI><A HREF="#1.3">1.3. How do I obtain a copy of the Python source?</A>
<LI><A HREF="#1.4">1.4. How do I get documentation on Python?</A>
<LI><A HREF="#1.5">1.5. Are there other ftp sites that mirror the Python distribution?</A>
<LI><A HREF="#1.6">1.6. Is there a newsgroup or mailing list devoted to Python?</A>
<LI><A HREF="#1.7">1.7. Is there a WWW page devoted to Python?</A>
<LI><A HREF="#1.8">1.8. Is the Python documentation available on the WWW?</A>
<LI><A HREF="#1.9">1.9. Are there any books on Python?</A>
<LI><A HREF="#1.10">1.10. Are there any published articles about Python that I can reference?</A>
<LI><A HREF="#1.11">1.11. Are there short introductory papers or talks on Python?</A>
<LI><A HREF="#1.12">1.12. How does the Python version numbering scheme work?</A>
<LI><A HREF="#1.13">1.13. How do I get a beta test version of Python?</A>
<LI><A HREF="#1.14">1.14. Are there copyright restrictions on the use of Python?</A>
<LI><A HREF="#1.15">1.15. Why was Python created in the first place?</A>
<LI><A HREF="#1.16">1.16. Do I have to like "Monty Python's Flying Circus"?</A>
<LI><A HREF="#1.17">1.17. What is Python good for?</A>
<LI><A HREF="#1.18">1.18. Can I use the FAQ Wizard software to maintain my own FAQ?</A>
<LI><A HREF="#1.19">1.19. Which editor has good support for editing Python source code?</A>
<LI><A HREF="#1.20">1.20. I've never programmed before. Is there a Python tutorial?</A>
<LI><A HREF="#1.21">1.21. Where in the world is www.python.org located?</A>
</UL>
<P>
<HR>
<H2>2. Python in the real world</H2>
<UL>
<LI><A HREF="#2.1">2.1. How many people are using Python?</A>
<LI><A HREF="#2.2">2.2. Have any significant projects been done in Python?</A>
<LI><A HREF="#2.3">2.3. Are there any commercial projects going on using Python?</A>
<LI><A HREF="#2.4">2.4. How stable is Python?</A>
<LI><A HREF="#2.5">2.5. What new developments are expected for Python in the future?</A>
<LI><A HREF="#2.6">2.6. Is it reasonable to propose incompatible changes to Python?</A>
<LI><A HREF="#2.7">2.7. What is the future of Python?</A>
<LI><A HREF="#2.8">2.8. What was the PSA, anyway?</A>
<LI><A HREF="#2.9">2.9. Deleted</A>
<LI><A HREF="#2.10">2.10. Deleted</A>
<LI><A HREF="#2.11">2.11. Is Python Y2K (Year 2000) Compliant?</A>
<LI><A HREF="#2.12">2.12. Is Python a good language in a class for beginning programmers?</A>
</UL>
<P>
<HR>
<H2>3. Building Python and Other Known Bugs</H2>
<UL>
<LI><A HREF="#3.1">3.1. Is there a test set?</A>
<LI><A HREF="#3.2">3.2. When running the test set, I get complaints about floating point operations, but when playing with floating point operations I cannot find anything wrong with them.</A>
<LI><A HREF="#3.3">3.3. Link errors after rerunning the configure script.</A>
<LI><A HREF="#3.4">3.4. The python interpreter complains about options passed to a script (after the script name).</A>
<LI><A HREF="#3.5">3.5. When building on the SGI, make tries to run python to create glmodule.c, but python hasn't been built or installed yet.</A>
<LI><A HREF="#3.6">3.6. I use VPATH but some targets are built in the source directory.</A>
<LI><A HREF="#3.7">3.7. Trouble building or linking with the GNU readline library.</A>
<LI><A HREF="#3.8">3.8. Trouble with socket I/O on older Linux 1.x versions.</A>
<LI><A HREF="#3.9">3.9. Trouble with prototypes on Ultrix.</A>
<LI><A HREF="#3.10">3.10. Other trouble building Python on platform X.</A>
<LI><A HREF="#3.11">3.11. How to configure dynamic loading on Linux.</A>
<LI><A HREF="#3.12">3.12. I can't get shared modules to work on Linux 2.0 (Slackware96)?</A>
<LI><A HREF="#3.13">3.13. Trouble when making modules shared on Linux.</A>
<LI><A HREF="#3.14">3.14. [deleted]</A>
<LI><A HREF="#3.15">3.15. Errors when linking with a shared library containing C++ code.</A>
<LI><A HREF="#3.16">3.16. Deleted</A>
<LI><A HREF="#3.17">3.17. Deleted.</A>
<LI><A HREF="#3.18">3.18. Compilation or link errors for the _tkinter module</A>
<LI><A HREF="#3.19">3.19. I configured and built Python for Tcl/Tk but "import Tkinter" fails.</A>
<LI><A HREF="#3.20">3.20. [deleted]</A>
<LI><A HREF="#3.21">3.21. Several common system calls are missing from the posix module.</A>
<LI><A HREF="#3.22">3.22. ImportError: No module named string, on MS Windows.</A>
<LI><A HREF="#3.23">3.23. Core dump on SGI when using the gl module.</A>
<LI><A HREF="#3.24">3.24. "Initializer not a constant" while building DLL on MS-Windows</A>
<LI><A HREF="#3.25">3.25. Output directed to a pipe or file disappears on Linux.</A>
<LI><A HREF="#3.26">3.26. [deleted]</A>
<LI><A HREF="#3.27">3.27. [deleted]</A>
<LI><A HREF="#3.28">3.28. How can I test if Tkinter is working?</A>
<LI><A HREF="#3.29">3.29. Is there a way to get the interactive mode of the python interpreter to perform function/variable name completion?</A>
<LI><A HREF="#3.30">3.30. Why is the Python interpreter not built as a shared library?</A>
<LI><A HREF="#3.31">3.31. Build with GCC on Solaris 2.6 (SunOS 5.6) fails</A>
<LI><A HREF="#3.32">3.32. Running "make clean" seems to leave problematic files that cause subsequent builds to fail.</A>
<LI><A HREF="#3.33">3.33. Submitting bug reports and patches</A>
<LI><A HREF="#3.34">3.34. I can't load shared libraries under Python 1.5.2, Solaris 7, and gcc 2.95.2</A>
<LI><A HREF="#3.35">3.35. In the regression test, test___all__ fails for the profile module. What's wrong?</A>
<LI><A HREF="#3.36">3.36. relocations remain against allocatable but non-writable sections</A>
</UL>
<P>
<HR>
<H2>4. Programming in Python</H2>
<UL>
<LI><A HREF="#4.1">4.1. Is there a source code level debugger with breakpoints, step, etc.?</A>
<LI><A HREF="#4.2">4.2. Can I create an object class with some methods implemented in C and others in Python (e.g. through inheritance)? (Also phrased as: Can I use a built-in type as base class?)</A>
<LI><A HREF="#4.3">4.3. Is there a curses/termcap package for Python?</A>
<LI><A HREF="#4.4">4.4. Is there an equivalent to C's onexit() in Python?</A>
<LI><A HREF="#4.5">4.5. [deleted]</A>
<LI><A HREF="#4.6">4.6. How do I iterate over a sequence in reverse order?</A>
<LI><A HREF="#4.7">4.7. My program is too slow. How do I speed it up?</A>
<LI><A HREF="#4.8">4.8. When I have imported a module, then edit it, and import it again (into the same Python process), the changes don't seem to take place. What is going on?</A>
<LI><A HREF="#4.9">4.9. How do I find the current module name?</A>
<LI><A HREF="#4.10">4.10. I have a module in which I want to execute some extra code when it is run as a script. How do I find out whether I am running as a script?</A>
<LI><A HREF="#4.11">4.11. I try to run a program from the Demo directory but it fails with ImportError: No module named ...; what gives?</A>
<LI><A HREF="#4.12">4.12. [deleted]</A>
<LI><A HREF="#4.13">4.13. What GUI toolkits exist for Python?</A>
<LI><A HREF="#4.14">4.14. Are there any interfaces to database packages in Python?</A>
<LI><A HREF="#4.15">4.15. Is it possible to write obfuscated one-liners in Python?</A>
<LI><A HREF="#4.16">4.16. Is there an equivalent of C's "?:" ternary operator?</A>
<LI><A HREF="#4.17">4.17. My class defines __del__ but it is not called when I delete the object.</A>
<LI><A HREF="#4.18">4.18. How do I change the shell environment for programs called using os.popen() or os.system()? Changing os.environ doesn't work.</A>
<LI><A HREF="#4.19">4.19. What is a class?</A>
<LI><A HREF="#4.20">4.20. What is a method?</A>
<LI><A HREF="#4.21">4.21. What is self?</A>
<LI><A HREF="#4.22">4.22. What is an unbound method?</A>
<LI><A HREF="#4.23">4.23. How do I call a method defined in a base class from a derived class that overrides it?</A>
<LI><A HREF="#4.24">4.24. How do I call a method from a base class without using the name of the base class?</A>
<LI><A HREF="#4.25">4.25. How can I organize my code to make it easier to change the base class?</A>
<LI><A HREF="#4.26">4.26. How can I find the methods or attributes of an object?</A>
<LI><A HREF="#4.27">4.27. I can't seem to use os.read() on a pipe created with os.popen().</A>
<LI><A HREF="#4.28">4.28. How can I create a stand-alone binary from a Python script?</A>
<LI><A HREF="#4.29">4.29. What WWW tools are there for Python?</A>
<LI><A HREF="#4.30">4.30. How do I run a subprocess with pipes connected to both input and output?</A>
<LI><A HREF="#4.31">4.31. How do I call a function if I have the arguments in a tuple?</A>
<LI><A HREF="#4.32">4.32. How do I enable font-lock-mode for Python in Emacs?</A>
<LI><A HREF="#4.33">4.33. Is there a scanf() or sscanf() equivalent?</A>
<LI><A HREF="#4.34">4.34. Can I have Tk events handled while waiting for I/O?</A>
<LI><A HREF="#4.35">4.35. How do I write a function with output parameters (call by reference)?</A>
<LI><A HREF="#4.36">4.36. Please explain the rules for local and global variables in Python.</A>
<LI><A HREF="#4.37">4.37. How can I have modules that mutually import each other?</A>
<LI><A HREF="#4.38">4.38. How do I copy an object in Python?</A>
<LI><A HREF="#4.39">4.39. How to implement persistent objects in Python? (Persistent == automatically saved to and restored from disk.)</A>
<LI><A HREF="#4.40">4.40. I try to use __spam and I get an error about _SomeClassName__spam.</A>
<LI><A HREF="#4.41">4.41. How do I delete a file? And other file questions.</A>
<LI><A HREF="#4.42">4.42. How to modify urllib or httplib to support HTTP/1.1?</A>
<LI><A HREF="#4.43">4.43. Unexplicable syntax errors in compile() or exec.</A>
<LI><A HREF="#4.44">4.44. How do I convert a string to a number?</A>
<LI><A HREF="#4.45">4.45. How do I convert a number to a string?</A>
<LI><A HREF="#4.46">4.46. How do I copy a file?</A>
<LI><A HREF="#4.47">4.47. How do I check if an object is an instance of a given class or of a subclass of it?</A>
<LI><A HREF="#4.48">4.48. What is delegation?</A>
<LI><A HREF="#4.49">4.49. How do I test a Python program or component.</A>
<LI><A HREF="#4.50">4.50. My multidimensional list (array) is broken! What gives?</A>
<LI><A HREF="#4.51">4.51. I want to do a complicated sort: can you do a Schwartzian Transform in Python?</A>
<LI><A HREF="#4.52">4.52. How to convert between tuples and lists?</A>
<LI><A HREF="#4.53">4.53. Files retrieved with urllib contain leading garbage that looks like email headers.</A>
<LI><A HREF="#4.54">4.54. How do I get a list of all instances of a given class?</A>
<LI><A HREF="#4.55">4.55. A regular expression fails with regex.error: match failure.</A>
<LI><A HREF="#4.56">4.56. I can't get signal handlers to work.</A>
<LI><A HREF="#4.57">4.57. I can't use a global variable in a function? Help!</A>
<LI><A HREF="#4.58">4.58. What's a negative index? Why doesn't list.insert() use them?</A>
<LI><A HREF="#4.59">4.59. How can I sort one list by values from another list?</A>
<LI><A HREF="#4.60">4.60. Why doesn't dir() work on builtin types like files and lists?</A>
<LI><A HREF="#4.61">4.61. How can I mimic CGI form submission (METHOD=POST)?</A>
<LI><A HREF="#4.62">4.62. If my program crashes with a bsddb (or anydbm) database open, it gets corrupted. How come?</A>
<LI><A HREF="#4.63">4.63. How do I make a Python script executable on Unix?</A>
<LI><A HREF="#4.64">4.64. How do you remove duplicates from a list?</A>
<LI><A HREF="#4.65">4.65. Are there any known year 2000 problems in Python?</A>
<LI><A HREF="#4.66">4.66. I want a version of map that applies a method to a sequence of objects! Help!</A>
<LI><A HREF="#4.67">4.67. How do I generate random numbers in Python?</A>
<LI><A HREF="#4.68">4.68. How do I access the serial (RS232) port?</A>
<LI><A HREF="#4.69">4.69. Images on Tk-Buttons don't work in Py15?</A>
<LI><A HREF="#4.70">4.70. Where is the math.py (socket.py, regex.py, etc.) source file?</A>
<LI><A HREF="#4.71">4.71. How do I send mail from a Python script?</A>
<LI><A HREF="#4.72">4.72. How do I avoid blocking in connect() of a socket?</A>
<LI><A HREF="#4.73">4.73. How do I specify hexadecimal and octal integers?</A>
<LI><A HREF="#4.74">4.74. How to get a single keypress at a time?</A>
<LI><A HREF="#4.75">4.75. How can I overload constructors (or methods) in Python?</A>
<LI><A HREF="#4.76">4.76. How do I pass keyword arguments from one method to another?</A>
<LI><A HREF="#4.77">4.77. What module should I use to help with generating HTML?</A>
<LI><A HREF="#4.78">4.78. How do I create documentation from doc strings?</A>
<LI><A HREF="#4.79">4.79. How do I read (or write) binary data?</A>
<LI><A HREF="#4.80">4.80. I can't get key bindings to work in Tkinter</A>
<LI><A HREF="#4.81">4.81. "import crypt" fails</A>
<LI><A HREF="#4.82">4.82. Are there coding standards or a style guide for Python programs?</A>
<LI><A HREF="#4.83">4.83. How do I freeze Tkinter applications?</A>
<LI><A HREF="#4.84">4.84. How do I create static class data and static class methods?</A>
<LI><A HREF="#4.85">4.85. __import__('x.y.z') returns <module 'x'>; how do I get z?</A>
<LI><A HREF="#4.86">4.86. Basic thread wisdom</A>
<LI><A HREF="#4.87">4.87. Why doesn't closing sys.stdout (stdin, stderr) really close it?</A>
<LI><A HREF="#4.88">4.88. What kinds of global value mutation are thread-safe?</A>
<LI><A HREF="#4.89">4.89. How do I modify a string in place?</A>
<LI><A HREF="#4.90">4.90. How to pass on keyword/optional parameters/arguments</A>
<LI><A HREF="#4.91">4.91. How can I get a dictionary to display its keys in a consistent order?</A>
<LI><A HREF="#4.92">4.92. Is there a Python tutorial?</A>
<LI><A HREF="#4.93">4.93. Deleted</A>
<LI><A HREF="#4.94">4.94. How do I get a single keypress without blocking?</A>
<LI><A HREF="#4.95">4.95. Is there an equivalent to Perl chomp()? (Remove trailing newline from string)</A>
<LI><A HREF="#4.96">4.96. Why is join() a string method when I'm really joining the elements of a (list, tuple, sequence)?</A>
<LI><A HREF="#4.97">4.97. How can my code discover the name of an object?</A>
<LI><A HREF="#4.98">4.98. Why are floating point calculations so inaccurate?</A>
<LI><A HREF="#4.99">4.99. I tried to open Berkeley DB file, but bsddb produces bsddb.error: (22, 'Invalid argument'). Help! How can I restore my data?</A>
<LI><A HREF="#4.100">4.100. What are the "best practices" for using import in a module?</A>
<LI><A HREF="#4.101">4.101. Is there a tool to help find bugs or perform static analysis?</A>
<LI><A HREF="#4.102">4.102. UnicodeError: ASCII [decoding,encoding] error: ordinal not in range(128)</A>
<LI><A HREF="#4.103">4.103. Using strings to call functions/methods</A>
<LI><A HREF="#4.104">4.104. How fast are exceptions?</A>
<LI><A HREF="#4.105">4.105. Sharing global variables across modules</A>
<LI><A HREF="#4.106">4.106. Why is cPickle so slow?</A>
<LI><A HREF="#4.107">4.107. When importing module XXX, why do I get "undefined symbol: PyUnicodeUCS2_..." ?</A>
<LI><A HREF="#4.108">4.108. How do I create a .pyc file?</A>
</UL>
<P>
<HR>
<H2>5. Extending Python</H2>
<UL>
<LI><A HREF="#5.1">5.1. Can I create my own functions in C?</A>
<LI><A HREF="#5.2">5.2. Can I create my own functions in C++?</A>
<LI><A HREF="#5.3">5.3. How can I execute arbitrary Python statements from C?</A>
<LI><A HREF="#5.4">5.4. How can I evaluate an arbitrary Python expression from C?</A>
<LI><A HREF="#5.5">5.5. How do I extract C values from a Python object?</A>
<LI><A HREF="#5.6">5.6. How do I use Py_BuildValue() to create a tuple of arbitrary length?</A>
<LI><A HREF="#5.7">5.7. How do I call an object's method from C?</A>
<LI><A HREF="#5.8">5.8. How do I catch the output from PyErr_Print() (or anything that prints to stdout/stderr)?</A>
<LI><A HREF="#5.9">5.9. How do I access a module written in Python from C?</A>
<LI><A HREF="#5.10">5.10. How do I interface to C++ objects from Python?</A>
<LI><A HREF="#5.11">5.11. mSQLmodule (or other old module) won't build with Python 1.5 (or later)</A>
<LI><A HREF="#5.12">5.12. I added a module using the Setup file and the make fails! Huh?</A>
<LI><A HREF="#5.13">5.13. I want to compile a Python module on my Red Hat Linux system, but some files are missing.</A>
<LI><A HREF="#5.14">5.14. What does "SystemError: _PyImport_FixupExtension: module yourmodule not loaded" mean?</A>
<LI><A HREF="#5.15">5.15. How to tell "incomplete input" from "invalid input"?</A>
<LI><A HREF="#5.16">5.16. How do I debug an extension?</A>
<LI><A HREF="#5.17">5.17. How do I find undefined Linux g++ symbols, __builtin_new or __pure_virtural</A>
<LI><A HREF="#5.18">5.18. How do I define and create objects corresponding to built-in/extension types</A>
</UL>
<P>
<HR>
<H2>6. Python's design</H2>
<UL>
<LI><A HREF="#6.1">6.1. Why isn't there a switch or case statement in Python?</A>
<LI><A HREF="#6.2">6.2. Why does Python use indentation for grouping of statements?</A>
<LI><A HREF="#6.3">6.3. Why are Python strings immutable?</A>
<LI><A HREF="#6.4">6.4. Delete</A>
<LI><A HREF="#6.5">6.5. Why does Python use methods for some functionality (e.g. list.index()) but functions for other (e.g. len(list))?</A>
<LI><A HREF="#6.6">6.6. Why can't I derive a class from built-in types (e.g. lists or files)?</A>
<LI><A HREF="#6.7">6.7. Why must 'self' be declared and used explicitly in method definitions and calls?</A>
<LI><A HREF="#6.8">6.8. Can't you emulate threads in the interpreter instead of relying on an OS-specific thread implementation?</A>
<LI><A HREF="#6.9">6.9. Why can't lambda forms contain statements?</A>
<LI><A HREF="#6.10">6.10. [deleted]</A>
<LI><A HREF="#6.11">6.11. [deleted]</A>
<LI><A HREF="#6.12">6.12. Why is there no more efficient way of iterating over a dictionary than first constructing the list of keys()?</A>
<LI><A HREF="#6.13">6.13. Can Python be compiled to machine code, C or some other language?</A>
<LI><A HREF="#6.14">6.14. How does Python manage memory?</A>
<LI><A HREF="#6.15">6.15. Why are there separate tuple and list data types?</A>
<LI><A HREF="#6.16">6.16. How are lists implemented?</A>
<LI><A HREF="#6.17">6.17. How are dictionaries implemented?</A>
<LI><A HREF="#6.18">6.18. Why must dictionary keys be immutable?</A>
<LI><A HREF="#6.19">6.19. How the heck do you make an array in Python?</A>
<LI><A HREF="#6.20">6.20. Why doesn't list.sort() return the sorted list?</A>
<LI><A HREF="#6.21">6.21. How do you specify and enforce an interface spec in Python?</A>
<LI><A HREF="#6.22">6.22. Why do all classes have the same type? Why do instances all have the same type?</A>
<LI><A HREF="#6.23">6.23. Why isn't all memory freed when Python exits?</A>
<LI><A HREF="#6.24">6.24. Why no class methods or mutable class variables?</A>
<LI><A HREF="#6.25">6.25. Why are default values sometimes shared between objects?</A>
<LI><A HREF="#6.26">6.26. Why no goto?</A>
<LI><A HREF="#6.27">6.27. How do you make a higher order function in Python?</A>
<LI><A HREF="#6.28">6.28. Why do I get a SyntaxError for a 'continue' inside a 'try'?</A>
<LI><A HREF="#6.29">6.29. Why can't raw strings (r-strings) end with a backslash?</A>
<LI><A HREF="#6.30">6.30. Why can't I use an assignment in an expression?</A>
<LI><A HREF="#6.31">6.31. Why doesn't Python have a "with" statement like some other languages?</A>
<LI><A HREF="#6.32">6.32. Why are colons required for if/while/def/class?</A>
<LI><A HREF="#6.33">6.33. Can't we get rid of the Global Interpreter Lock?</A>
</UL>
<P>
<HR>
<H2>7. Using Python on non-UNIX platforms</H2>
<UL>
<LI><A HREF="#7.1">7.1. Is there a Mac version of Python?</A>
<LI><A HREF="#7.2">7.2. Are there DOS and Windows versions of Python?</A>
<LI><A HREF="#7.3">7.3. Is there an OS/2 version of Python?</A>
<LI><A HREF="#7.4">7.4. Is there a VMS version of Python?</A>
<LI><A HREF="#7.5">7.5. What about IBM mainframes, or other non-UNIX platforms?</A>
<LI><A HREF="#7.6">7.6. Where are the source or Makefiles for the non-UNIX versions?</A>
<LI><A HREF="#7.7">7.7. What is the status and support for the non-UNIX versions?</A>
<LI><A HREF="#7.8">7.8. I have a PC version but it appears to be only a binary. Where's the library?</A>
<LI><A HREF="#7.9">7.9. Where's the documentation for the Mac or PC version?</A>
<LI><A HREF="#7.10">7.10. How do I create a Python program file on the Mac or PC?</A>
<LI><A HREF="#7.11">7.11. How can I use Tkinter on Windows 95/NT?</A>
<LI><A HREF="#7.12">7.12. cgi.py (or other CGI programming) doesn't work sometimes on NT or win95!</A>
<LI><A HREF="#7.13">7.13. Why doesn't os.popen() work in PythonWin on NT?</A>
<LI><A HREF="#7.14">7.14. How do I use different functionality on different platforms with the same program?</A>
<LI><A HREF="#7.15">7.15. Is there an Amiga version of Python?</A>
<LI><A HREF="#7.16">7.16. Why doesn't os.popen()/win32pipe.popen() work on Win9x?</A>
</UL>
<P>
<HR>
<H2>8. Python on Windows</H2>
<UL>
<LI><A HREF="#8.1">8.1. Using Python for CGI on Microsoft Windows</A>
<LI><A HREF="#8.2">8.2. How to check for a keypress without blocking?</A>
<LI><A HREF="#8.3">8.3. $PYTHONPATH</A>
<LI><A HREF="#8.4">8.4. dedent syntax errors</A>
<LI><A HREF="#8.5">8.5. How do I emulate os.kill() in Windows?</A>
<LI><A HREF="#8.6">8.6. Why does os.path.isdir() fail on NT shared directories?</A>
<LI><A HREF="#8.7">8.7. PyRun_SimpleFile() crashes on Windows but not on Unix</A>
<LI><A HREF="#8.8">8.8. Import of _tkinter fails on Windows 95/98</A>
<LI><A HREF="#8.9">8.9. Can't extract the downloaded documentation on Windows</A>
<LI><A HREF="#8.10">8.10. Can't get Py_RunSimpleFile() to work.</A>
<LI><A HREF="#8.11">8.11. Where is Freeze for Windows?</A>
<LI><A HREF="#8.12">8.12. Is a *.pyd file the same as a DLL?</A>
<LI><A HREF="#8.13">8.13. Missing cw3215mt.dll (or missing cw3215.dll)</A>
<LI><A HREF="#8.14">8.14. How to make python scripts executable:</A>
<LI><A HREF="#8.15">8.15. Warning about CTL3D32 version from installer</A>
<LI><A HREF="#8.16">8.16. How can I embed Python into a Windows application?</A>
<LI><A HREF="#8.17">8.17. Setting up IIS 5 to use Python for CGI</A>
<LI><A HREF="#8.18">8.18. How do I run a Python program under Windows?</A>
</UL>
<HR>
<H1>1. General information and availability</H1>
<HR>
<H2><A NAME="1.1">1.1. What is Python?</A></H2>
Python is an interpreted, interactive, object-oriented programming
language. It incorporates modules, exceptions, dynamic typing, very
high level dynamic data types, and classes. Python combines
remarkable power with very clear syntax. It has interfaces to many
system calls and libraries, as well as to various window systems, and
is extensible in C or C++. It is also usable as an extension language
for applications that need a programmable interface. Finally, Python
is portable: it runs on many brands of UNIX, on the Mac, and on PCs
under MS-DOS, Windows, Windows NT, and OS/2.
<P>
To find out more, the best thing to do is to start reading the
tutorial from the documentation set (see a few questions further
down).
<P>
See also question 1.17 (what is Python good for).
<P>
<A HREF="faqw.py?req=edit&file=faq01.001.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.001.htp">Log info</A>
/ Last changed on Mon May 26 16:05:18 1997 by
<A HREF="mailto:[email protected]">GvR</A>
<P>
<HR>
<H2><A NAME="1.2">1.2. Why is it called Python?</A></H2>
Apart from being a computer scientist, I'm also a fan of "Monty
Python's Flying Circus" (a BBC comedy series from the seventies, in
the -- unlikely -- case you didn't know). It occurred to me one day
that I needed a name that was short, unique, and slightly mysterious.
And I happened to be reading some scripts from the series at the
time... So then I decided to call my language Python.
<P>
By now I don't care any more whether you use a Python, some other
snake, a foot or 16-ton weight, or a wood rat as a logo for Python!
<P>
<A HREF="faqw.py?req=edit&file=faq01.002.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.002.htp">Log info</A>
/ Last changed on Thu Aug 24 00:50:41 2000 by
<A HREF="mailto:[email protected]">GvR</A>
<P>
<HR>
<H2><A NAME="1.3">1.3. How do I obtain a copy of the Python source?</A></H2>
The latest Python source distribution is always available from
python.org, at <A HREF="http://www.python.org/download">http://www.python.org/download</A>. The latest development sources can be obtained via anonymous CVS from SourceForge, at <A HREF="http://www.sf.net/projects/python">http://www.sf.net/projects/python</A> .
<P>
The source distribution is a gzipped tar file containing the complete C source, LaTeX
documentation, Python library modules, example programs, and several
useful pieces of freely distributable software. This will compile and
run out of the box on most UNIX platforms. (See section 7 for
non-UNIX information.)
<P>
Older versions of Python are also available from python.org.
<P>
<A HREF="faqw.py?req=edit&file=faq01.003.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.003.htp">Log info</A>
/ Last changed on Tue Apr 9 17:06:16 2002 by
<A HREF="mailto:[email protected]">A.M. Kuchling</A>
<P>
<HR>
<H2><A NAME="1.4">1.4. How do I get documentation on Python?</A></H2>
All documentation is available on-line, starting at <A HREF="http://www.python.org/doc">http://www.python.org/doc</A>/.
<P>
The LaTeX source for the documentation is part of the source
distribution. If you don't have LaTeX, the latest Python
documentation set is available, in various formats like postscript
and html, by anonymous ftp - visit the above URL for links to the
current versions.
<P>
PostScript for a high-level description of Python is in the file nluug-paper.ps
(a separate file on the ftp site).
<P>
<A HREF="faqw.py?req=edit&file=faq01.004.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.004.htp">Log info</A>
/ Last changed on Wed Jan 21 12:02:55 1998 by
<A HREF="mailto:[email protected]">Ken Manheimer</A>
<P>
<HR>
<H2><A NAME="1.5">1.5. Are there other ftp sites that mirror the Python distribution?</A></H2>
The following anonymous ftp sites keep mirrors of the Python
distribution:
<P>
USA:
<P>
<PRE>
<A HREF="ftp://ftp.python.org/pub/python">ftp://ftp.python.org/pub/python</A>/
<A HREF="ftp://gatekeeper.dec.com/pub/plan/python">ftp://gatekeeper.dec.com/pub/plan/python</A>/
<A HREF="ftp://ftp.uu.net/languages/python">ftp://ftp.uu.net/languages/python</A>/
<A HREF="ftp://ftp.wustl.edu/graphics/graphics/sgi-stuff/python">ftp://ftp.wustl.edu/graphics/graphics/sgi-stuff/python</A>/
<A HREF="ftp://ftp.sterling.com/programming/languages/python">ftp://ftp.sterling.com/programming/languages/python</A>/
<A HREF="ftp://uiarchive.cso.uiuc.edu/pub/lang/python">ftp://uiarchive.cso.uiuc.edu/pub/lang/python</A>/
<A HREF="ftp://ftp.pht.com/mirrors/python/python">ftp://ftp.pht.com/mirrors/python/python</A>/
<A HREF="ftp://ftp.cdrom.com/pub/python">ftp://ftp.cdrom.com/pub/python</A>/
</PRE>
Europe:
<P>
<PRE>
<A HREF="ftp://ftp.cwi.nl/pub/python">ftp://ftp.cwi.nl/pub/python</A>/
<A HREF="ftp://ftp.funet.fi/pub/languages/python">ftp://ftp.funet.fi/pub/languages/python</A>/
<A HREF="ftp://ftp.sunet.se/pub/lang/python">ftp://ftp.sunet.se/pub/lang/python</A>/
<A HREF="ftp://unix.hensa.ac.uk/mirrors/uunet/languages/python">ftp://unix.hensa.ac.uk/mirrors/uunet/languages/python</A>/
<A HREF="ftp://ftp.lip6.fr/pub/python">ftp://ftp.lip6.fr/pub/python</A>/
<A HREF="ftp://sunsite.cnlab-switch.ch/mirror/python">ftp://sunsite.cnlab-switch.ch/mirror/python</A>/
<A HREF="ftp://ftp.informatik.tu-muenchen.de/pub/comp/programming/languages/python">ftp://ftp.informatik.tu-muenchen.de/pub/comp/programming/languages/python</A>/
</PRE>
Australia:
<P>
<PRE>
<A HREF="ftp://ftp.dstc.edu.au/pub/python">ftp://ftp.dstc.edu.au/pub/python</A>/
</PRE>
<P>
<A HREF="faqw.py?req=edit&file=faq01.005.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.005.htp">Log info</A>
/ Last changed on Wed Mar 24 09:20:49 1999 by
<A HREF="mailto:[email protected]">A.M. Kuchling</A>
<P>
<HR>
<H2><A NAME="1.6">1.6. Is there a newsgroup or mailing list devoted to Python?</A></H2>
There is a newsgroup, comp.lang.python,
and a mailing list. The newsgroup and mailing list are gatewayed into
each other -- if you can read news it's unnecessary to subscribe to
the mailing list. To subscribe to the mailing list
(<A HREF="mailto:[email protected]">[email protected]</A>) visit its Mailman webpage at
<A HREF="http://www.python.org/mailman/listinfo/python-list">http://www.python.org/mailman/listinfo/python-list</A>
<P>
More info about the newsgroup and mailing list, and about other lists,
can be found at
<A HREF="http://www.python.org/psa/MailingLists.html">http://www.python.org/psa/MailingLists.html</A>.
<P>
Archives of the newsgroup are kept by Deja News and accessible
through the "Python newsgroup search" web page,
<A HREF="http://www.python.org/search/search_news.html">http://www.python.org/search/search_news.html</A>.
This page also contains pointer to other archival collections.
<P>
<A HREF="faqw.py?req=edit&file=faq01.006.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.006.htp">Log info</A>
/ Last changed on Wed Jun 23 09:29:36 1999 by
<A HREF="mailto:[email protected]">GvR</A>
<P>
<HR>
<H2><A NAME="1.7">1.7. Is there a WWW page devoted to Python?</A></H2>
Yes, <A HREF="http://www.python.org">http://www.python.org</A>/ is the official Python home page.
<P>
<A HREF="faqw.py?req=edit&file=faq01.007.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.007.htp">Log info</A>
/ Last changed on Fri May 23 14:42:59 1997 by
<A HREF="mailto:[email protected]">Ken Manheimer</A>
<P>
<HR>
<H2><A NAME="1.8">1.8. Is the Python documentation available on the WWW?</A></H2>
Yes. Python 2.0 documentation is available from
<A HREF="http://www.pythonlabs.com/tech/python2.0/doc">http://www.pythonlabs.com/tech/python2.0/doc</A>/ and from
<A HREF="http://www.python.org/doc">http://www.python.org/doc</A>/. Note that most documentation
is available for on-line browsing as well as for downloading.
<P>
<A HREF="faqw.py?req=edit&file=faq01.008.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.008.htp">Log info</A>
/ Last changed on Tue Jan 2 03:14:08 2001 by
<A HREF="mailto:[email protected]">Moshe Zadka</A>
<P>
<HR>
<H2><A NAME="1.9">1.9. Are there any books on Python?</A></H2>
Yes, many, and more are being published. See
the python.org Wiki at <A HREF="http://www.python.org/cgi-bin/moinmoin/PythonBooks">http://www.python.org/cgi-bin/moinmoin/PythonBooks</A> for a list.
<P>
You can also search online bookstores for "Python"
(and filter out the Monty Python references; or
perhaps search for "Python" and "language").
<P>
<A HREF="faqw.py?req=edit&file=faq01.009.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.009.htp">Log info</A>
/ Last changed on Mon Aug 5 19:08:49 2002 by
<A HREF="mailto:[email protected]">amk</A>
<P>
<HR>
<H2><A NAME="1.10">1.10. Are there any published articles about Python that I can reference?</A></H2>
If you can't reference the web site, and you don't want to reference the books
(see previous question), there are several articles on Python that you could
reference.
<P>
Most publications about Python are collected on the Python web site:
<P>
<PRE>
<A HREF="http://www.python.org/doc/Publications.html">http://www.python.org/doc/Publications.html</A>
</PRE>
It is no longer recommended to reference this
very old article by Python's author:
<P>
<PRE>
Guido van Rossum and Jelke de Boer, "Interactively Testing Remote
Servers Using the Python Programming Language", CWI Quarterly, Volume
4, Issue 4 (December 1991), Amsterdam, pp 283-303.
</PRE>
<P>
<A HREF="faqw.py?req=edit&file=faq01.010.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.010.htp">Log info</A>
/ Last changed on Sat Jul 4 20:52:31 1998 by
<A HREF="mailto:[email protected]">GvR</A>
<P>
<HR>
<H2><A NAME="1.11">1.11. Are there short introductory papers or talks on Python?</A></H2>
There are several - you can find links to some of them collected at
<A HREF="http://www.python.org/doc/Hints.html#intros">http://www.python.org/doc/Hints.html#intros</A>.
<P>
<A HREF="faqw.py?req=edit&file=faq01.011.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.011.htp">Log info</A>
/ Last changed on Fri May 23 15:04:05 1997 by
<A HREF="mailto:[email protected]">Ken Manheimer</A>
<P>
<HR>
<H2><A NAME="1.12">1.12. How does the Python version numbering scheme work?</A></H2>
Python versions are numbered A.B.C or A.B. A is the major version
number -- it is only incremented for really major changes in the
language. B is the minor version number, incremented for less
earth-shattering changes. C is the micro-level -- it is
incremented for each bugfix release. See PEP 6 for more information
about bugfix releases.
<P>
Not all releases have bugfix releases.
Note that in the past (ending with 1.5.2),
micro releases have added significant changes;
in fact the changeover from 0.9.9 to 1.0.0 was the first time
that either A or B changed!
<P>
Alpha, beta and release candidate versions have an additional suffixes.
The suffix for an alpha version is "aN" for some small number N, the
suffix for a beta version is "bN" for some small number N, and the
suffix for a release candidate version is "cN" for some small number N.
<P>
Note that (for instance) all versions labeled 2.0aN precede the
versions labeled 2.0bN, which precede versions labeled 2.0cN, and
<I>those</I> precede 2.0.
<P>
As a rule, no changes are made between release candidates and the final
release unless there are show-stopper bugs.
<P>
You may also find version numbers with a "+" suffix, e.g. "2.2+".
These are unreleased versions, built directly from the CVS trunk.
<P>
See also the documentation for sys.version, sys.hexversion, and
sys.version_info.
<P>
<A HREF="faqw.py?req=edit&file=faq01.012.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.012.htp">Log info</A>
/ Last changed on Mon Jan 14 06:34:17 2002 by
<A HREF="mailto:[email protected]">GvR</A>
<P>
<HR>
<H2><A NAME="1.13">1.13. How do I get a beta test version of Python?</A></H2>
All releases, including alphas, betas and release candidates, are announced on
comp.lang.python and comp.lang.python.announce newsgroups,
which are gatewayed into the <A HREF="mailto:[email protected]">[email protected]</A> and
<A HREF="mailto:[email protected]">[email protected]</A>. In addition, all these announcements appear on
the Python home page, at <A HREF="http://www.python.org">http://www.python.org</A>.
<P>
You can also access the development version of Python through CVS. See <A HREF="http://sourceforge.net/cvs/?group_id=5470">http://sourceforge.net/cvs/?group_id=5470</A> for details. If you're not familiar with CVS, documents like <A HREF="http://linux.oreillynet.com/pub/a/linux/2002/01/03/cvs_intro.html">http://linux.oreillynet.com/pub/a/linux/2002/01/03/cvs_intro.html</A>
provide an introduction.
<P>
<A HREF="faqw.py?req=edit&file=faq01.013.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.013.htp">Log info</A>
/ Last changed on Mon Jun 3 00:57:08 2002 by
<A HREF="mailto:[email protected]">Neal Norwitz</A>
<P>
<HR>
<H2><A NAME="1.14">1.14. Are there copyright restrictions on the use of Python?</A></H2>
Hardly. You can do anything you want with the source, as long as
you leave the copyrights in, and display those copyrights in any
documentation about Python that you produce. Also, don't use the
author's institute's name in publicity without prior written
permission, and don't hold them responsible for anything (read the
actual copyright for a precise legal wording).
<P>
In particular, if you honor the copyright rules, it's OK to use Python
for commercial use, to sell copies of Python in source or binary form,
or to sell products that enhance Python or incorporate Python (or part
of it) in some form. I would still like to know about all commercial
use of Python!
<P>
<A HREF="faqw.py?req=edit&file=faq01.014.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.014.htp">Log info</A>
<P>
<HR>
<H2><A NAME="1.15">1.15. Why was Python created in the first place?</A></H2>
Here's a <I>very</I> brief summary of what got me started:
<P>
I had extensive experience with implementing an interpreted language
in the ABC group at CWI, and from working with this group I had
learned a lot about language design. This is the origin of many
Python features, including the use of indentation for statement
grouping and the inclusion of very-high-level data types (although the
details are all different in Python).
<P>
I had a number of gripes about the ABC language, but also liked many
of its features. It was impossible to extend the ABC language (or its
implementation) to remedy my complaints -- in fact its lack of
extensibility was one of its biggest problems.
I had some experience with using Modula-2+ and talked with the
designers of Modula-3 (and read the M3 report). M3 is the origin of
the syntax and semantics used for exceptions, and some other Python
features.
<P>
I was working in the Amoeba distributed operating system group at
CWI. We needed a better way to do system administration than by
writing either C programs or Bourne shell scripts, since Amoeba had
its own system call interface which wasn't easily accessible from the
Bourne shell. My experience with error handling in Amoeba made me
acutely aware of the importance of exceptions as a programming
language feature.
<P>
It occurred to me that a scripting language with a syntax like ABC
but with access to the Amoeba system calls would fill the need. I
realized that it would be foolish to write an Amoeba-specific
language, so I decided that I needed a language that was generally
extensible.
<P>
During the 1989 Christmas holidays, I had a lot of time on my hand,
so I decided to give it a try. During the next year, while still
mostly working on it in my own time, Python was used in the Amoeba
project with increasing success, and the feedback from colleagues made
me add many early improvements.
<P>
In February 1991, after just over a year of development, I decided
to post to USENET. The rest is in the Misc/HISTORY file.
<P>
<A HREF="faqw.py?req=edit&file=faq01.015.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.015.htp">Log info</A>
/ Last changed on Fri May 23 00:06:23 1997 by
<A HREF="mailto:[email protected]">GvR</A>
<P>
<HR>
<H2><A NAME="1.16">1.16. Do I have to like "Monty Python's Flying Circus"?</A></H2>
No, but it helps. Pythonistas like the occasional reference to SPAM,
and of course, nobody expects the Spanish Inquisition
<P>
The two main reasons to use Python are:
<P>
<PRE>
- Portable
- Easy to learn
</PRE>
The <I>three</I> main reasons to use Python are:
<P>
<PRE>
- Portable
- Easy to learn
- Powerful standard library
</PRE>
(And nice red uniforms.)
<P>
And remember, there is <I>no</I> rule six.
<P>
<A HREF="faqw.py?req=edit&file=faq01.016.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.016.htp">Log info</A>
/ Last changed on Wed May 28 10:39:21 1997 by
<A HREF="mailto:[email protected]">GvR</A>
<P>
<HR>
<H2><A NAME="1.17">1.17. What is Python good for?</A></H2>
Python is used in many situations where a great deal of dynamism,
ease of use, power, and flexibility are required.
<P>
In the area of basic text
manipulation core Python (without any non-core extensions) is easier
to use and is roughly as fast as just about any language, and this makes Python
good for many system administration type tasks and for CGI programming
and other application areas that manipulate text and strings and such.
<P>
When augmented with
standard extensions (such as PIL, COM, Numeric, oracledb, kjbuckets,
tkinter, win32api, etc.)
or special purpose extensions (that you write, perhaps using helper tools such
as SWIG, or using object protocols such as ILU/CORBA or COM) Python
becomes a very convenient "glue" or "steering"
language that helps make heterogeneous collections of unrelated
software packages work together.
For example by combining Numeric with oracledb you can help your
SQL database do statistical analysis, or even Fourier transforms.
One of the features that makes Python excel in the "glue language" role
is Python's simple, usable, and powerful C language runtime API.
<P>
Many developers also use Python extensively as a graphical user
interface development aide.
<P>
<A HREF="faqw.py?req=edit&file=faq01.017.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.017.htp">Log info</A>
/ Last changed on Sat May 24 10:13:11 1997 by
<A HREF="mailto:[email protected]">Aaron Watters</A>
<P>
<HR>
<H2><A NAME="1.18">1.18. Can I use the FAQ Wizard software to maintain my own FAQ?</A></H2>
Sure. It's in Tools/faqwiz/ of the python source tree.
<P>
<A HREF="faqw.py?req=edit&file=faq01.018.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.018.htp">Log info</A>
/ Last changed on Fri Mar 29 06:50:32 2002 by
<A HREF="mailto:[email protected]">Aahz</A>
<P>
<HR>
<H2><A NAME="1.19">1.19. Which editor has good support for editing Python source code?</A></H2>
On Unix, the first choice is Emacs/XEmacs. There's an elaborate
mode for editing Python code, which is available from the Python
source distribution (Misc/python-mode.el). It's also bundled
with XEmacs (we're still working on legal details to make it possible
to bundle it with FSF Emacs). And it has its own web page:
<P>
<PRE>
<A HREF="http://www.python.org/emacs/python-mode/index.html">http://www.python.org/emacs/python-mode/index.html</A>
</PRE>
There are many other choices, for Unix, Windows or Macintosh.
Richard Jones compiled a table from postings on the Python newsgroup:
<P>
<PRE>
<A HREF="http://www.bofh.asn.au/~richard/editors.html">http://www.bofh.asn.au/~richard/editors.html</A>
</PRE>
See also FAQ question 7.10 for some more Mac and Win options.
<P>
<A HREF="faqw.py?req=edit&file=faq01.019.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.019.htp">Log info</A>
/ Last changed on Mon Jun 15 23:21:04 1998 by
<A HREF="mailto:[email protected]">Gvr</A>
<P>
<HR>
<H2><A NAME="1.20">1.20. I've never programmed before. Is there a Python tutorial?</A></H2>
There are several, and at least one book.
All information for beginning Python programmers is collected here:
<P>
<PRE>
<A HREF="http://www.python.org/doc/Newbies.html">http://www.python.org/doc/Newbies.html</A>
</PRE>
<P>
<A HREF="faqw.py?req=edit&file=faq01.020.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.020.htp">Log info</A>
/ Last changed on Wed Sep 5 05:34:07 2001 by
<A HREF="mailto:[email protected]">GvR</A>
<P>
<HR>
<H2><A NAME="1.21">1.21. Where in the world is www.python.org located?</A></H2>
It's currently in Amsterdam, graciously hosted by XS4ALL:
<P>
<PRE>
<A HREF="http://www.xs4all.nl">http://www.xs4all.nl</A>
</PRE>
Thanks to Thomas Wouters for setting this up!!!!
<P>
<A HREF="faqw.py?req=edit&file=faq01.021.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq01.021.htp">Log info</A>
/ Last changed on Fri Aug 3 21:49:27 2001 by
<A HREF="mailto:[email protected]">GvR</A>
<P>
<HR>
<H1>2. Python in the real world</H1>
<HR>
<H2><A NAME="2.1">2.1. How many people are using Python?</A></H2>
Certainly thousands, and quite probably tens of thousands of users.
More are seeing the light each day. The comp.lang.python newsgroup is
very active, but overall there is no accurate estimate of the number of subscribers or Python users.
<P>
Jacek Artymiak has created a Python Users Counter; you can see the
current count by visiting
<A HREF="http://www.wszechnica.safenet.pl/cgi-bin/checkpythonuserscounter.py">http://www.wszechnica.safenet.pl/cgi-bin/checkpythonuserscounter.py</A>
(this will not increment the counter; use the link there if you haven't
added yourself already). Most Python users appear not to have registered themselves.
<P>
<A HREF="faqw.py?req=edit&file=faq02.001.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq02.001.htp">Log info</A>
/ Last changed on Thu Feb 21 23:29:18 2002 by
<A HREF="mailto:[email protected]">GvR</A>
<P>
<HR>
<H2><A NAME="2.2">2.2. Have any significant projects been done in Python?</A></H2>
At CWI (the former home of Python), we have written a 20,000 line
authoring environment for transportable hypermedia presentations, a
5,000 line multimedia teleconferencing tool, as well as many many
smaller programs.
<P>
At CNRI (Python's new home), we have written two large applications:
Grail, a fully featured web browser (see
<A HREF="http://grail.cnri.reston.va.us">http://grail.cnri.reston.va.us</A>),
and the Knowbot Operating Environment,
a distributed environment for mobile code.
<P>
The University of Virginia uses Python to control a virtual reality
engine. See <A HREF="http://alice.cs.cmu.edu">http://alice.cs.cmu.edu</A>.
<P>
The ILU project at Xerox PARC can generate Python glue for ILU
interfaces. See <A HREF="ftp://ftp.parc.xerox.com/pub/ilu/ilu.html">ftp://ftp.parc.xerox.com/pub/ilu/ilu.html</A>. ILU
is a free CORBA compliant ORB which supplies distributed object
connectivity to a host of platforms using a host of languages.
<P>
Mark Hammond and Greg Stein and others are interfacing Python to
Microsoft's COM and ActiveX architectures. This means, among other
things, that Python may be used in active server pages or as a COM
controller (for example to automatically extract from or insert information
into Excel or MSAccess or any other COM aware application).
Mark claims Python can even be a ActiveX scripting host (which
means you could embed JScript inside a Python application, if you
had a strange sense of humor). Python/AX/COM is distributed as part
of the PythonWin distribution.
<P>
The University of California, Irvine uses a student administration
system called TELE-Vision written entirely in Python. Contact: Ray
Price <A HREF="mailto:[email protected]">[email protected]</A>.
<P>
The Melbourne Cricket Ground (MCG) in Australia (a 100,000+ person venue)
has it's scoreboard system written largely in Python on MS Windows.
Python expressions are used to create almost every scoring entry that
appears on the board. The move to Python/C++ away from exclusive C++
has provided a level of functionality that would simply not have been
viable otherwise.
<P>
See also the next question.
<P>
Note: this FAQ entry is really old.
See <A HREF="http://www.python.org/psa/Users.html">http://www.python.org/psa/Users.html</A> for a more recent list.
<P>
<A HREF="faqw.py?req=edit&file=faq02.002.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq02.002.htp">Log info</A>
/ Last changed on Wed Oct 25 13:24:15 2000 by
<A HREF="mailto:[email protected]">GvR</A>
<P>
<HR>
<H2><A NAME="2.3">2.3. Are there any commercial projects going on using Python?</A></H2>
Yes, there's lots of commercial activity using Python. See
<A HREF="http://www.python.org/psa/Users.html">http://www.python.org/psa/Users.html</A> for a list.
<P>
<A HREF="faqw.py?req=edit&file=faq02.003.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq02.003.htp">Log info</A>
/ Last changed on Wed Oct 14 18:17:33 1998 by
<A HREF="mailto:[email protected]">ken</A>
<P>
<HR>
<H2><A NAME="2.4">2.4. How stable is Python?</A></H2>
Very stable. New, stable releases have been coming out roughly every 3 to 12 months since 1991, and this seems likely to continue.
<P>
With the introduction of retrospective "bugfix" releases the stability of the language implementations can be, and is being, improved independently of the new features offered by more recent major or minor releases. Bugfix releases, indicated by a third component of the version number, only fix known problems and do not gratuitously introduce new and possibly incompatible features or modified library functionality.
<P>
Release 2.2 got its first bugfix on April 10, 2002. The new version
number is now 2.2.1. The 2.1 release, at 2.1.3, can probably be
considered the "most stable" platform because it has been bugfixed
twice.
<P>
<A HREF="faqw.py?req=edit&file=faq02.004.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq02.004.htp">Log info</A>
/ Last changed on Tue Jul 23 10:20:04 2002 by
<A HREF="mailto:[email protected]">Jens Kubieziel</A>
<P>
<HR>
<H2><A NAME="2.5">2.5. What new developments are expected for Python in the future?</A></H2>
See <A HREF="http://www.python.org/peps">http://www.python.org/peps</A>/ for the Python Enhancement
Proposals (PEPs). PEPs are design
documents
describing a suggested new feature for Python, providing
a concise technical specification and a rationale.
<P>
Also, follow the discussions on the python-dev mailing list.
<P>
<A HREF="faqw.py?req=edit&file=faq02.005.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq02.005.htp">Log info</A>
/ Last changed on Tue Apr 9 17:09:51 2002 by
<A HREF="mailto:[email protected]">A.M. Kuchling</A>
<P>
<HR>
<H2><A NAME="2.6">2.6. Is it reasonable to propose incompatible changes to Python?</A></H2>
In general, no. There are already millions of lines of Python code
around the world, so any changes in the language that invalidates more
than a very small fraction of existing programs has to be frowned
upon. Even if you can provide a conversion program, there still is
the problem of updating all documentation. Providing a gradual
upgrade path is the only way if a feature has to be changed.
<P>
See <A HREF="http://www.python.org/peps/pep-0005.html">http://www.python.org/peps/pep-0005.html</A> for the proposed
mechanism for creating backwards-incompatibilities.
<P>
<A HREF="faqw.py?req=edit&file=faq02.006.htp">Edit this entry</A> /
<A HREF="faqw.py?req=log&file=faq02.006.htp">Log info</A>
/ Last changed on Mon Apr 1 22:13:47 2002 by
<A HREF="mailto:[email protected]">Fred Drake</A>
<P>
<HR>
<H2><A NAME="2.7">2.7. What is the future of Python?</A></H2>
Please see <A HREF="http://www.python.org/peps">http://www.python.org/peps</A>/ for proposals of future
activities. One of the PEPs (Python Enhancement Proposals) deals