Python Language FAQ - Table of Contents
This FAQ newsgroup posting has been automatically converted from an
HTML snapshot of the original Python FAQ; please refer to the original
"Python FAQ Wizard" at http://grail.cnri.reston.va.us/cgi-bin/faqw.py
if source code snippets given in this document do not work - incidentally
some formatting information may have been lost during the conversion.
----------------------------------------------------------------------------
The whole Python FAQ - Table of Contents
Last changed on Mon Jun 28 19:36:09 1999 EDT
(Entries marked with ** were changed within the last 24 hours; entries
marked with * were changed within the last 7 days.)
----------------------------------------------------------------------------
1. General information and availability
1.1. What is Python?
1.2. Why is it called Python?
1.3. How do I obtain a copy of the Python source?
1.4. How do I get documentation on Python?
1.5. Are there other ftp sites that mirror the Python distribution?
1.6. Is there a newsgroup or mailing list devoted to Python?
1.7. Is there a WWW page devoted to Python?
1.8. Is the Python documentation available on the WWW?
1.9. Are there any books on Python?
1.10. Are there any published articles about Python that I can
reference?
1.11. Are there short introductory papers or talks on Python?
1.12. How does the Python version numbering scheme work?
1.13. How do I get a beta test version of Python?
1.14. Are there copyright restrictions on the use of Python?
1.15. Why was Python created in the first place?
1.16. Do I have to like "Monty Python's Flying Circus"?
1.17. What is Python good for?
1.18. Can I use the FAQ Wizard software to maintain my own FAQ?
1.19. Which editor has good support for editing Python source code?
----------------------------------------------------------------------------
2. Python in the real world
2.1. How many people are using Python?
2.2. Have any significant projects been done in Python?
2.3. Are there any commercial projects going on using Python?
2.4. How stable is Python?
2.5. What new developments are expected for Python in the future?
2.6. Is it reasonable to propose incompatible changes to Python?
2.7. What is the future of Python?
2.8. What is the PSA, anyway?
2.9. How do I join the PSA?
2.10. What are the benefits of joining the PSA?
2.11. Is Python Y2K (Year 2000) Compliant?
----------------------------------------------------------------------------
3. Building Python and Other Known Bugs
3.1. Is there a test set?
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.
3.3. Link errors after rerunning the configure script.
3.4. The python interpreter complains about options passed to a script
(after the script name).
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.
3.6. I use VPATH but some targets are built in the source directory.
3.7. Trouble building or linking with the GNU readline library.
3.8. Trouble with socket I/O on older Linux 1.x versions.
3.9. Trouble with prototypes on Ultrix.
3.10. Other trouble building Python on platform X.
3.11. How to configure dynamic loading on Linux.
3.12. I can't get shared modules to work on Linux 2.0 (Slackware96)?
3.13. Trouble when making modules shared on Linux.
3.14. How to use threads on Linux.
3.15. Errors when linking with a shared library containing C++ code.
3.16. I built with tkintermodule.c enabled but get 'Tkinter not found'
3.17. I built with Tk 4.0 but Tkinter complains about the Tk version.
3.18. Compilation or link errors for the _tkinter module
3.19. I configured and built Python for Tcl/Tk but "import Tkinter"
fails.
3.20. Tk doesn't work right on DEC Alpha.
3.21. Several common system calls are missing from the posix module.
3.22. ImportError: No module named string, on MS Windows.
3.23. Core dump on SGI when using the gl module.
3.24. "Initializer not a constant" while building DLL on MS-Windows
3.25. Output directed to a pipe or file disappears on Linux.
3.26. Syntax Errors all over the place in Linux with libc 5.4
3.27. Crash in XIO on Linux when using Tkinter.
3.28. How can I test if Tkinter is working?
3.29. Is there a way to get the interactive mode of the python
interpreter to perform function/variable name completion?
3.30. Why is the Python interpreter not built as a shared library?
3.31. Build with GCC on Solaris 2.6 (SunOS 5.6) fails
3.32. Running "make clean" seems to leave problematic files that cause
subsequent builds to fail.
----------------------------------------------------------------------------
4. Programming in Python
4.1. Is there a source code level debugger with breakpoints, step,
etc.?
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?)
4.3. Is there a curses/termcap package for Python?
4.4. Is there an equivalent to C's onexit() in Python?
4.5. When I define a function nested inside another function, the
nested function seemingly can't access the local variables of the outer
function. What is going on? How do I pass local data to a nested
function?
4.6. How do I iterate over a sequence in reverse order?
4.7. My program is too slow. How do I speed it up?
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?
4.9. How do I find the current module name?
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?
4.11. I try to run a program from the Demo directory but it fails with
ImportError: No module named ...; what gives?
4.12. I have successfully built Python with STDWIN but it can't find
some modules (e.g. stdwinevents).
4.13. What GUI toolkits exist for Python?
4.14. Are there any interfaces to database packages in Python?
4.15. Is it possible to write obfuscated one-liners in Python?
4.16. Is there an equivalent of C's "?:" ternary operator?
4.17. My class defines __del__ but it is not called when I delete the
object.
4.18. How do I change the shell environment for programs called using
os.popen() or os.system()? Changing os.environ doesn't work.
4.19. What is a class?
4.20. What is a method?
4.21. What is self?
4.22. What is an unbound method?
4.23. How do I call a method defined in a base class from a derived
class that overrides it?
4.24. How do I call a method from a base class without using the name
of the base class?
4.25. How can I organize my code to make it easier to change the base
class?
4.26. How can I find the methods or attributes of an object?
4.27. I can't seem to use os.read() on a pipe created with os.popen().
4.28. How can I create a stand-alone binary from a Python script?
4.29. What WWW tools are there for Python?
4.30. How do I run a subprocess with pipes connected to both input and
output?
4.31. How do I call a function if I have the arguments in a tuple?
4.32. How do I enable font-lock-mode for Python in Emacs?
4.33. Is there a scanf() or sscanf() equivalent?
4.34. Can I have Tk events handled while waiting for I/O?
4.35. How do I write a function with output parameters (call by
reference)?
4.36. Please explain the rules for local and global variables in
Python.
4.37. How can I have modules that mutually import each other?
4.38. How do I copy an object in Python?
4.39. How to implement persistent objects in Python? (Persistent ==
automatically saved to and restored from disk.)
4.40. I try to use __spam and I get an error about
_SomeClassName__spam.
4.41. How do I delete a file? And other file questions.
4.42. How to modify urllib or httplib to support HTTP/1.1?
4.43. Unexplicable syntax errors in compile() or exec.
4.44. How do I convert a string to a number?
4.45. How do I convert a number to a string?
4.46. How do I copy a file?
4.47. How do I check if an object is an instance of a given class or of
a subclass of it?
4.48. What is delegation?
4.49. How do I test a Python program or component.
4.50. My multidimensional list (array) is broken! What gives?
4.51. I want to do a complicated sort: can you do a Schwartzian
Transform in Python?
4.52. How to convert between tuples and lists?
4.53. Files retrieved with urllib contain leading garbage that looks
like email headers.
4.54. How do I get a list of all instances of a given class?
4.55. A regular expression fails with regex.error: match failure.
4.56. I can't get signal handlers to work.
4.57. I can't use a global variable in a function? Help!
4.58. What's a negative index? Why doesn't list.insert() use them?
4.59. How can I sort one list by values from another list?
4.60. Why doesn't dir() work on builtin types like files and lists?
4.61. How can I mimic CGI form submission (METHOD=POST)?
4.62. If my program crashes with a bsddb (or anydbm) database open, it
gets corrupted. How come?
4.63. How do I make a Python script executable on Unix?
4.64. How do you remove duplicates from a list?
4.65. Are there any known year 2000 problems in Python?
4.66. I want a version of map that applies a method to a sequence of
objects! Help!
4.67. How do I generate random numbers in Python?
4.68. How do I access the serial (RS232) port?
4.69. Images on Tk-Buttons don't work in Py15?
4.70. Where is the math.py (socket.py, regex.py, etc.) source file?
4.71. How do I send mail from a Python script?
4.72. How do I avoid blocking in connect() of a socket?
4.73. How do I specify hexadecimal and octal integers?
4.74. How to get a single keypress at a time?
4.75. How can I overload constructors (or methods) in Python?
4.76. How do I pass keyword arguments from one method to another?
4.77. What module should I use to help with generating HTML?
4.78. How do I create documentation from doc strings?
4.79. How do I read (or write) binary data?
4.80. I can't get key bindings to work in Tkinter
4.81. "import crypt" fails
4.82. Are there coding standards or a style guide for Python programs?
4.83. How do I freeze Tkinter applications?
4.84. How do I create static class data and static class methods?
4.85. __import__('x.y.z') returns
participants (1)
-
Markus Fleck