| Release: | 2.6 |
|---|---|
| Date: | February 28, 2010 |
| 中譯者: | 劉世琪 |
| 中譯日期: | 2010/03/01 |
雖然The Python Language Reference描述了Python語言確切的語法跟語義,這個函式參考手冊描述Python散佈的標準函式,它也描述一些常包括在Python發行版本裡的可選部份。
Python的標準函式庫事非常廣泛的,它提供了範圍廣泛的服務就像下面列表所描述的,函式庫包含內建模組(用C寫的)提供了存取系統功能像是檔案I/O沒有這個很難成為Python程式設計師,以及那些用Python寫成的模組用來提供每天的程式設計都會發生的很多問題的標準解法,有些模組明確地設計來鼓勵及加強Python程式的移植性,這是藉由抽離平台特定的模組進入與平台無關的API中。
Windows平台的Python安裝程式通常包含了整個標準函式庫以及很多額外的部份,對Unix-like作業系統來說Python通常提供一組的套件,所以它需要使用作業系統提供的套件工具來取得這些額外的部份。
除了標準函式庫之外,還有越來越多數以百計的組件(從個別的程式跟模組到套件跟整個應用程式開發架構),可以參閱Python Package Index.
- 1. Introduction
- 2. Built-in Functions
- 3. Non-essential Built-in Functions
- 4. Built-in Constants
- 5. Built-in Objects
- 6. Built-in Types
- 6.1. Truth Value Testing
- 6.2. Boolean Operations — and, or, not
- 6.3. Comparisons
- 6.4. Numeric Types — int, float, long, complex
- 6.5. Iterator Types
- 6.6. Sequence Types — str, unicode, list, tuple, buffer, xrange
- 6.7. Set Types — set, frozenset
- 6.8. Mapping Types — dict
- 6.9. File Objects
- 6.10. Context Manager Types
- 6.11. Other Built-in Types
- 6.12. Special Attributes
- 7. Built-in Exceptions
- 8. String Services
- 8.1. string — Common string operations
- 8.2. re — Regular expression operations
- 8.3. struct — Interpret strings as packed binary data
- 8.4. difflib — Helpers for computing deltas
- 8.5. StringIO — Read and write strings as files
- 8.6. cStringIO — Faster version of StringIO
- 8.7. textwrap — Text wrapping and filling
- 8.8. codecs — Codec registry and base classes
- 8.9. unicodedata — Unicode Database
- 8.10. stringprep — Internet String Preparation
- 8.11. fpformat — Floating point conversions
- 9. Data Types
- 9.1. datetime — Basic date and time types
- 9.2. calendar — General calendar-related functions
- 9.3. collections — High-performance container datatypes
- 9.4. heapq — Heap queue algorithm
- 9.5. bisect — Array bisection algorithm
- 9.6. array — Efficient arrays of numeric values
- 9.7. sets — Unordered collections of unique elements
- 9.8. sched — Event scheduler
- 9.9. mutex — Mutual exclusion support
- 9.10. queue — A synchronized queue class
- 9.11. weakref — Weak references
- 9.12. UserDict — Class wrapper for dictionary objects
- 9.13. UserList — Class wrapper for list objects
- 9.14. UserString — Class wrapper for string objects
- 9.15. types — Names for built-in types
- 9.16. new — Creation of runtime internal objects
- 9.17. copy — Shallow and deep copy operations
- 9.18. pprint — Data pretty printer
- 9.19. repr — Alternate repr() implementation
- 10. Numeric and Mathematical Modules
- 10.1. numbers — Numeric abstract base classes
- 10.2. math — Mathematical functions
- 10.3. cmath — Mathematical functions for complex numbers
- 10.4. decimal — Decimal fixed point and floating point arithmetic
- 10.5. fractions — Rational numbers
- 10.6. random — Generate pseudo-random numbers
- 10.7. itertools — Functions creating iterators for efficient looping
- 10.8. functools — Higher order functions and operations on callable objects
- 10.9. operator — Standard operators as functions
- 11. File and Directory Access
- 11.1. os.path — Common pathname manipulations
- 11.2. fileinput — Iterate over lines from multiple input streams
- 11.3. stat — Interpreting stat() results
- 11.4. statvfs — Constants used with os.statvfs()
- 11.5. filecmp — File and Directory Comparisons
- 11.6. tempfile — Generate temporary files and directories
- 11.7. glob — Unix style pathname pattern expansion
- 11.8. fnmatch — Unix filename pattern matching
- 11.9. linecache — Random access to text lines
- 11.10. shutil — High-level file operations
- 11.11. dircache — Cached directory listings
- 11.12. macpath — Mac OS 9 path manipulation functions
- 12. Data Persistence
- 12.1. pickle — Python object serialization
- 12.2. cPickle — A faster pickle
- 12.3. copy_reg — Register pickle support functions
- 12.4. shelve — Python object persistence
- 12.5. marshal — Internal Python object serialization
- 12.6. anydbm — Generic access to DBM-style databases
- 12.7. whichdb — Guess which DBM module created a database
- 12.8. dbm — Simple “database” interface
- 12.9. gdbm — GNU’s reinterpretation of dbm
- 12.10. dbhash — DBM-style interface to the BSD database library
- 12.11. bsddb — Interface to Berkeley DB library
- 12.12. dumbdbm — Portable DBM implementation
- 12.13. sqlite3 — DB-API 2.0 interface for SQLite databases
- 13. Data Compression and Archiving
- 14. File Formats
- 15. Cryptographic Services
- 16. Generic Operating System Services
- 16.1. os — Miscellaneous operating system interfaces
- 16.2. io — Core tools for working with streams
- 16.3. time — Time access and conversions
- 16.4. optparse — More powerful command line option parser
- 16.5. getopt — Parser for command line options
- 16.6. logging — Logging facility for Python
- 16.7. getpass — Portable password input
- 16.8. curses — Terminal handling for character-cell displays
- 16.9. curses.textpad — Text input widget for curses programs
- 16.10. curses.wrapper — Terminal handler for curses programs
- 16.11. curses.ascii — Utilities for ASCII characters
- 16.12. curses.panel — A panel stack extension for curses
- 16.13. platform — Access to underlying platform’s identifying data
- 16.14. errno — Standard errno system symbols
- 16.15. ctypes — A foreign function library for Python
- 17. Optional Operating System Services
- 17.1. select — Waiting for I/O completion
- 17.2. threading — Higher-level threading interface
- 17.3. thread — Multiple threads of control
- 17.4. dummy_threading — Drop-in replacement for the threading module
- 17.5. dummy_thread — Drop-in replacement for the thread module
- 17.6. multiprocessing — Process-based “threading” interface
- 17.7. mmap — Memory-mapped file support
- 17.8. readline — GNU readline interface
- 17.9. rlcompleter — Completion function for GNU readline
- 18. Interprocess Communication and Networking
- 18.1. subprocess — Subprocess management
- 18.2. socket — Low-level networking interface
- 18.3. ssl — SSL wrapper for socket objects
- 18.4. signal — Set handlers for asynchronous events
- 18.5. popen2 — Subprocesses with accessible I/O streams
- 18.6. asyncore — Asynchronous socket handler
- 18.7. asynchat — Asynchronous socket command/response handler
- 19. Internet Data Handling
- 19.1. email — An email and MIME handling package
- 19.2. json — JSON encoder and decoder
- 19.3. mailcap — Mailcap file handling
- 19.4. mailbox — Manipulate mailboxes in various formats
- 19.5. mhlib — Access to MH mailboxes
- 19.6. mimetools — Tools for parsing MIME messages
- 19.7. mimetypes — Map filenames to MIME types
- 19.8. MimeWriter — Generic MIME file writer
- 19.9. mimify — MIME processing of mail messages
- 19.10. multifile — Support for files containing distinct parts
- 19.11. rfc822 — Parse RFC 2822 mail headers
- 19.12. base64 — RFC 3548: Base16, Base32, Base64 Data Encodings
- 19.13. binhex — Encode and decode binhex4 files
- 19.14. binascii — Convert between binary and ASCII
- 19.15. quopri — Encode and decode MIME quoted-printable data
- 19.16. uu — Encode and decode uuencode files
- 20. Structured Markup Processing Tools
- 20.1. HTMLParser — Simple HTML and XHTML parser
- 20.2. sgmllib — Simple SGML parser
- 20.3. htmllib — A parser for HTML documents
- 20.4. htmlentitydefs — Definitions of HTML general entities
- 20.5. xml.parsers.expat — Fast XML parsing using Expat
- 20.6. xml.dom — The Document Object Model API
- 20.7. xml.dom.minidom — Lightweight DOM implementation
- 20.8. xml.dom.pulldom — Support for building partial DOM trees
- 20.9. xml.sax — Support for SAX2 parsers
- 20.10. xml.sax.handler — Base classes for SAX handlers
- 20.11. xml.sax.saxutils — SAX Utilities
- 20.12. xml.sax.xmlreader — Interface for XML parsers
- 20.13. xml.etree.ElementTree — The ElementTree XML API
- 21. Internet Protocols and Support
- 21.1. webbrowser — Convenient Web-browser controller
- 21.2. cgi — Common Gateway Interface support
- 21.3. cgitb — Traceback manager for CGI scripts
- 21.4. wsgiref — WSGI Utilities and Reference Implementation
- 21.5. urllib — Open arbitrary resources by URL
- 21.6. urllib2 — extensible library for opening URLs
- 21.7. httplib — HTTP protocol client
- 21.8. ftplib — FTP protocol client
- 21.9. poplib — POP3 protocol client
- 21.10. imaplib — IMAP4 protocol client
- 21.11. nntplib — NNTP protocol client
- 21.12. smtplib — SMTP protocol client
- 21.13. smtpd — SMTP Server
- 21.14. telnetlib — Telnet client
- 21.15. uuid — UUID objects according to RFC 4122
- 21.16. urlparse — Parse URLs into components
- 21.17. SocketServer — A framework for network servers
- 21.18. BaseHTTPServer — Basic HTTP server
- 21.19. SimpleHTTPServer — Simple HTTP request handler
- 21.20. CGIHTTPServer — CGI-capable HTTP request handler
- 21.21. cookielib — Cookie handling for HTTP clients
- 21.22. Cookie — HTTP state management
- 21.23. xmlrpclib — XML-RPC client access
- 21.24. SimpleXMLRPCServer — Basic XML-RPC server
- 21.25. DocXMLRPCServer — Self-documenting XML-RPC server
- 22. Multimedia Services
- 22.1. audioop — Manipulate raw audio data
- 22.2. imageop — Manipulate raw image data
- 22.3. aifc — Read and write AIFF and AIFC files
- 22.4. sunau — Read and write Sun AU files
- 22.5. wave — Read and write WAV files
- 22.6. chunk — Read IFF chunked data
- 22.7. colorsys — Conversions between color systems
- 22.8. imghdr — Determine the type of an image
- 22.9. sndhdr — Determine type of sound file
- 22.10. ossaudiodev — Access to OSS-compatible audio devices
- 23. Internationalization
- 24. Program Frameworks
- 25. Graphical User Interfaces with Tk
- 26. Development Tools
- 26.1. pydoc — Documentation generator and online help system
- 26.2. doctest — Test interactive Python examples
- 26.3. unittest — Unit testing framework
- 26.4. 2to3 - Automated Python 2 to 3 code translation
- 26.5. test — Regression tests package for Python
- 26.6. test.test_support — Utility functions for tests
- 27. Debugging and Profiling
- 28. Python Runtime Services
- 28.1. sys — System-specific parameters and functions
- 28.2. __builtin__ — Built-in objects
- 28.3. future_builtins — Python 3 builtins
- 28.4. __main__ — Top-level script environment
- 28.5. warnings — Warning control
- 28.6. contextlib — Utilities for with-statement contexts
- 28.7. abc — Abstract Base Classes
- 28.8. atexit — Exit handlers
- 28.9. traceback — Print or retrieve a stack traceback
- 28.10. __future__ — Future statement definitions
- 28.11. gc — Garbage Collector interface
- 28.12. inspect — Inspect live objects
- 28.13. site — Site-specific configuration hook
- 28.14. user — User-specific configuration hook
- 28.15. fpectl — Floating point exception control
- 29. Custom Python Interpreters
- 30. Restricted Execution
- 31. Importing Modules
- 32. Python Language Services
- 32.1. parser — Access Python parse trees
- 32.2. Abstract Syntax Trees
- 32.3. symtable — Access to the compiler’s symbol tables
- 32.4. symbol — Constants used with Python parse trees
- 32.5. token — Constants used with Python parse trees
- 32.6. keyword — Testing for Python keywords
- 32.7. tokenize — Tokenizer for Python source
- 32.8. tabnanny — Detection of ambiguous indentation
- 32.9. pyclbr — Python class browser support
- 32.10. py_compile — Compile Python source files
- 32.11. compileall — Byte-compile Python libraries
- 32.12. dis — Disassembler for Python bytecode
- 32.13. pickletools — Tools for pickle developers
- 32.14. distutils — Building and installing Python modules
- 33. Python compiler package
- 34. Miscellaneous Services
- 35. MS Windows Specific Services
- 36. Unix Specific Services
- 36.1. posix — The most common POSIX system calls
- 36.2. pwd — The password database
- 36.3. spwd — The shadow password database
- 36.4. grp — The group database
- 36.5. crypt — Function to check Unix passwords
- 36.6. dl — Call C functions in shared objects
- 36.7. termios — POSIX style tty control
- 36.8. tty — Terminal control functions
- 36.9. pty — Pseudo-terminal utilities
- 36.10. fcntl — The fcntl() and ioctl() system calls
- 36.11. pipes — Interface to shell pipelines
- 36.12. posixfile — File-like objects with locking support
- 36.13. resource — Resource usage information
- 36.14. nis — Interface to Sun’s NIS (Yellow Pages)
- 36.15. syslog — Unix syslog library routines
- 36.16. commands — Utilities for running commands
- 37. Mac OS X specific services
- 37.1. ic — Access to the Mac OS X Internet Config
- 37.2. MacOS — Access to Mac OS interpreter features
- 37.3. macostools — Convenience routines for file manipulation
- 37.4. findertools — The finder‘s Apple Events interface
- 37.5. EasyDialogs — Basic Macintosh dialogs
- 37.6. FrameWork — Interactive application framework
- 37.7. autoGIL — Global Interpreter Lock handling in event loops
- 37.8. Mac OS Toolbox Modules
- 37.9. ColorPicker — Color selection dialog
- 38. MacPython OSA Modules
- 39. SGI IRIX Specific Services
- 39.1. al — Audio functions on the SGI
- 39.2. AL — Constants used with the al module
- 39.3. cd — CD-ROM access on SGI systems
- 39.4. fl — FORMS library for graphical user interfaces
- 39.5. FL — Constants used with the fl module
- 39.6. flp — Functions for loading stored FORMS designs
- 39.7. fm — Font Manager interface
- 39.8. gl — Graphics Library interface
- 39.9. DEVICE — Constants used with the gl module
- 39.10. GL — Constants used with the gl module
- 39.11. imgfile — Support for SGI imglib files
- 39.12. jpeg — Read and write JPEG files
- 40. SunOS Specific Services
- 41. Undocumented Modules
Trackback URL for this post:
http://achi.idv.tw/trackback/2332