Python Library Reference
::-- zhuyj [2008-07-07 13:06:57]
Contents
- Introduction
- Built-in Objects
- Built-in Types
- String Services
- Data Types
- Numeric and Mathematical Modules
- Internet Data Handling
- Structured Markup Processing Tools
- File Formats
- Cryptographic Services
- File and Directory Access
- Data Compression and Archiving
- Data Persistence
- Generic Operating System Services
- Optional Operating System Services
- Unix Specific Services
- Interprocess Communication and Networking
- Internet Protocols and Support
- Multimedia Services
- Graphical User Interfaces with Tk
- Internationalization
- Program Frameworks
- Development Tools
- The Python Debugger
- The Python Profilers
- Python Runtime Services
- Custom Python Interpreters
- Restricted Execution
- Importing Modules
- Python Language Services
- Python compiler package
- Abstract Syntax Trees
- Miscellaneous Services
- SGI IRIX Specific Services
- SunOS Specific Services
- MS Windows Specific Services
- 交流
Python Library Reference Guido van Rossum Python Software Foundation
Email: [email protected] Fred L. Drake, Jr., editor
Release 2.5
- 19th September, 2006
1. Introduction
The Python library contains several different kinds of components. It contains data types that would normally be considered part of the core
of a language, such as numbers and lists. For these types, the Python language core defines the form of literals and places some constraints on their semantics, but does not fully define the semantics. (On the other hand, the language core does define syntactic properties like the spelling and priorities of operators.) The library also contains built-in functions and exceptions -- objects that can be used by all Python code without the need of an import statement. Some of these are defined by the core language, but many are not essential for the core semantics and are only described here. The bulk of the library, however, consists of a collection of modules. There are many ways to dissect this collection. Some modules are written in C and built in to the Python interpreter; others are written in Python and imported in source form. Some modules provide interfaces that are highly specific to Python, like printing a stack trace; some provide interfaces that are specific to particular operating systems, such as access to specific hardware; others provide interfaces that are specific to a particular application domain, like the World Wide Web. Some modules are available in all versions and ports of Python; others are only available when the underlying system supports or requires them; yet others are available only when a particular configuration option was chosen at the time when Python was compiled and installed. This manual is organized from the inside out: it first describes the built-in data types, then the built-in functions and exceptions, and finally the modules, grouped in chapters of related modules. The ordering of the chapters as well as the ordering of the modules within each chapter is roughly from most relevant to least important. This means that if you start reading this manual from the start, and skip to the next chapter when you get bored, you will get a reasonable overview of the available modules and application areas that are supported by the Python library. Of course, you don't have to read it like a novel -- you can also browse the table of contents (in front of the manual), or look for a specific function, module or term in the index (in the back). And finally, if you enjoy learning about random subjects, you choose a random page number (see module random) and read a section or two. Regardless of the order in which you read the sections of this manual, it helps to start with chapter 2, Built-in Types, Exceptions and Functions, as the remainder of the manual assumes familiarity with this material. Let the show begin!
2. Built-in Objects
3. Built-in Types
4. String Services
5. Data Types
6. Numeric and Mathematical Modules
7. Internet Data Handling
This chapter describes modules which support handling data formats commonly used on the Internet.
email -- An email and MIME handling package
mailcap -- Mailcap file handling.
mailbox -- Manipulate mailboxes in various formats
mhlib -- Access to MH mailboxes
mimetools -- Tools for parsing MIME messages
mimetypes -- Map filenames to MIME types
MimeWriter -- Generic MIME file writer
mimify -- MIME processing of mail messages
multifile-- Support for files containing distinct parts
rfc822 -- Parse RFC 2822 mail headers
base64 -- RFC 3548: Base16, Base32, Base64 Data Encodings
binhex -- Encode and decode binhex4 files
binascii -- Convert between binary and ASCII
quopri -- Encode and decode MIME quoted-printable data
uu -- Encode and decode uuencode files
8. Structured Markup Processing Tools
9. File Formats
10. Cryptographic Services
11. File and Directory Access
12. Data Compression and Archiving
13. Data Persistence
14. Generic Operating System Services
15. Optional Operating System Services
16. Unix Specific Services
17. Interprocess Communication and Networking
18. Internet Protocols and Support
19. Multimedia Services
20. Graphical User Interfaces with Tk
21. Internationalization
22. Program Frameworks
23. Development Tools
24. The Python Debugger
25. The Python Profilers
26. Python Runtime Services
27. Custom Python Interpreters
28. Restricted Execution
29. Importing Modules
30. Python Language Services
31. Python compiler package
32. Abstract Syntax Trees
33. Miscellaneous Services
34. SGI IRIX Specific Services
35. SunOS Specific Services
36. MS Windows Specific Services