Python標準庫(各種模組介紹)__Python

來源:互聯網
上載者:User
Python Standard Library /06/07 20:10:08 編譯 0.1. 關於本書 0.2. 代碼約定 0.3. 關於例子 0.4. 如何聯絡我們 核心模組 1.1. 介紹 1.2. _ _builtin_ _ 模組 1.3. exceptions 模組 1.4. os 模組 1.5. os.path 模組 1.6. stat 模組 1.7. string 模組 1.8. re 模組 1.9. math 模組 1.10. cmath 模組 1.11. operator 模組 1.12. copy 模組 1.13. sys 模組 1.14. atexit 模組 1.15. time 模組 1.16. types 模組 1.17. gc 模組 更多標準模組 2.1. 概覽 2.2. fileinput 模組 2.3. shutil 模組 2.4. tempfile 模組 2.5. StringIO 模組 2.6. cStringIO 模組 2.7. mmap 模組 2.8. UserDict 模組 2.9. UserList 模組 2.10. UserString 模組 2.11. traceback 模組 2.12. errno 模組 2.13. getopt 模組 2.14. getpass 模組 2.15. glob 模組 2.16. fnmatch 模組 2.17. random 模組 2.18. whrandom 模組 2.19. md5 模組 2.20. sha 模組 2.21. crypt 模組 2.22. rotor 模組 2.23. zlib 模組 2.24. code 模組 線程和進程 3.1. 概覽 3.2. threading 模組 3.3. Queue 模組 3.4. thread 模組 3.5. commands 模組 3.6. pipes 模組 3.7. popen2 模組 3.8. signal 模組 資料表示 4.1. 概覽 4.2. array 模組 4.3. struct 模組 4.4. xdrlib 模組 4.5. marshal 模組 4.6. pickle 模組 4.7. cPickle 模組 4.8. copy_reg 模組 4.9. pprint 模組 4.10. repr 模組 4.11. base64 模組 4.12. binhex 模組 4.13. quopri 模組 4.14. uu 模組 4.15. binascii 模組 檔案格式 5.1. 概覽 5.2. xmllib 模組 5.3. xml.parsers.expat 模組 5.4. sgmllib 模組 5.5. htmllib 模組 5.6. htmlentitydefs 模組 5.7. formatter 模組 5.8. ConfigParser 模組 5.9. netrc 模組 5.10. shlex 模組 5.11. zipfile 模組 5.12. gzip 模組 郵件和新聞訊息處理 6.1. 概覽 6.2. rfc822 模組 6.3. mimetools 模組 6.4. MimeWriter 模組 6.5. mailbox 模組 6.6. mailcap 模組 6.7. mimetypes 模組 6.8. packmail 模組 6.9. mimify 模組 6.10. multifile 模組 網路通訊協定 7.1. 概覽 7.2. socket 模組 7.3. select 模組 7.4. asyncore 模組 7.5. asynchat 模組 7.6. urllib 模組 7.7. urlparse 模組 7.8. cookie 模組 7.9. robotparser 模組 7.10. ftplib 模組 7.11. gopherlib 模組 7.12. httplib 模組 7.13. poplib 模組 7.14. imaplib 模組 7.15. smtplib 模組 7.16. telnetlib 模組 7.17. nntplib 模組 7.18. SocketServer 模組 7.19. BaseHTTPServer 模組 7.20. SimpleHTTPServer 模組 7.21. CGIHTTPServer 模組 7.22. cgi 模組 7.23. webbrowser 模組 國際化 8.1. locale 模組 8.2. unicodedata 模組 8.3. ucnhash 模組 多媒體相關模組 9.1. 概覽 9.2. imghdr 模組 9.3. sndhdr 模組 9.4. whatsound 模組 9.5. aifc 模組 9.6. sunau 模組 9.7. sunaudio 模組 9.8. wave 模組 9.9. audiodev 模組 9.10. winsound 模組 資料儲存 10.1. 概覽 10.2. anydbm 模組 10.3. whichdb 模組 10.4. shelve 模組 10.5. dbhash 模組 10.6. dbm 模組 10.7. dumbdbm 模組 10.8. gdbm 模組 工具和公用程式 11.1. dis 模組 11.2. pdb 模組 11.3. bdb 模組 11.4. profile 模組 11.5. pstats 模組 11.6. tabnanny 模組 其他模組 12.1. 概覽 12.2. fcntl 模組 12.3. pwd 模組 12.4. grp 模組 12.5. nis 模組 12.6. curses 模組 12.7. termios 模組 12.8. tty 模組 12.9. resource 模組 12.10. syslog 模組 12.11. msvcrt 模組 12.12. nt 模組 12.13. _winreg 模組 12.14. posix 模組 執行支援模組 13.1. dospath 模組 13.2. macpath 模組 13.3. ntpath 模組 13.4. posixpath 模組 13.5. strop 模組 13.6. imp 模組 13.7. new 模組 13.8. pre 模組 13.9. sre 模組 13.10. py_compile 模組 13.11. compileall 模組 13.12. ihooks 模組 13.13. linecache 模組 13.14. macurl2path 模組 13.15. nturl2path 模組 13.16. tokenize 模組 13.17. keyword 模組 13.18. parser 模組 13.19. symbol 模組 13.20. token 模組 其他模組 14.1. 概覽 14.2. pyclbr 模組 14.3. filecmp 模組 14.4. cmd 模組 14.5. rexec 模組 14.6. Bastion 模組 14.7. readline 模組 14.8. rlcompleter 模組 14.9. statvfs 模組 14.10. calendar 模組 14.11. sched 模組 14.12. statcache 模組 14.13. grep 模組 14.14. dircache 模組 14.15. dircmp 模組 14.16. cmp 模組 14.17. cmpcache 模組 14.18. util 模組 14.19. soundex 模組 14.20. timing 模組 14.21. posixfile 模組 14.22. bisect 模組 14.23. knee 模組 14.24. tzparse 模組 14.25. regex 模組 14.26. regsub 模組 14.27. reconvert 模組 14.28. regex_syntax 模組 14.29. find 模組 Py 2.0 後新增模組 後記 "We'd like to pretend that 'Fredrik' is a role, but even hundreds of volunteers couldn't possibly keep up. No, 'Fredrik' is the result of crossing an http server with a spam filter with an emacs whatsit and some other stuff besides." -Gordon McMillan, June 1998

Python 2.0發布附帶了一個包含200個以上模組的可擴充的標準庫. 本書簡要地介紹每個模組並提供至少一個例子來說明如何使用它. 本書一共包含360個例子. 0.1. 關於本書 "Those people who have nothing better to do than post on the Internet all day long are rarely the ones who have the most insights." - Jakob Nielsen, December 1998

五年前我偶然遇到了 Python, 開始了我的 Python 之旅, 我花費了大量的時間 在 comp.lang.python 新聞群組裡回答問題. 也許某個人發現一個模組正是他想要的, 但是卻不知道如何使用它. 也許某個人為他的任務挑選的不合適的模組. 也許某個人已經厭 倦了發明新輪子. 大多時候, 一個簡短的例子要比一份手冊文檔更有協助.

本書是超過3,000個新聞群組討論的精華部分, 當然也有很多的新指令碼, 為了涵蓋標準庫的每個角落.

我儘力使得每個指令碼都易於理解, 易於重用代碼. 我有意縮短注釋的長度, 如果你想更深入地 瞭解背景, 那麼你可以參閱每個 Python 發布中的參考手冊. 本書的重要之處在於範例代碼.

我們歡迎任何評論, 建議, 以及 bug 報告, 請將它們發送到 fredrik@pythonware.com. 我將閱讀盡我所能閱讀所有的郵件, 但可能回複不是那麼及時.

本書的相關更新內容以及其他資訊請訪問 http://www.pythonware.com/people/fredrik/librarybook.htm

為什麼沒有Tkinter?

本書涵蓋了整個標準庫, 除了(可選的)Tkinter ui(user-interface : 使用者介面) 庫. 有很多原因, 更多是因為時間, 本書的空間, 以及我正在寫另一本關於 Tkinter 的書.

關於這些書的資訊, 請訪問 http://www.pythonware.com/people/fredrik/tkinterbook.htm. (不用看了,又一404)

產品細節

本書使用DocBook SGML編寫, 我使用了一系列的工具, 包括Secret Labs' PythonWorks, Excosoft Documentor, James Clark's Jade DSSSL processor, Norm Walsh's DocBook stylesheets, 當然,還有一些 Python 指令碼.

感謝幫忙校對的人們: Tim Peters, Guido van Rossum, David Ascher, Mark Lutz, 和 Rael Dornfest, 以及 PythonWare 成員: Matthew Ellis, Håkan Karlsson, 和 Rune Uhlin.

感謝 Lenny Muellner, 他協助我把SGML檔案轉變為你們現在所看到的這本書, 以及Christien Shangraw, 他將那些代碼檔案集合起來做成了隨書CD (可以在http://examples.oreilly.com/pythonsl 找到, 竟然沒有404, 奇蹟). 0.2. 代碼約定

本書使用以下習慣用法:

斜體 用於檔案名稱和命令. 還用於定義術語.

等寬字型 e.g. Python 用於代碼以及方法,模組,操作符,函數,語句,屬性等的名稱.

等寬粗體 用於代碼執行結果. 0.3. 關於例子

除非提到,所有例子都可以在 Python 1.5.2 和 Python 2.0 下運行. 能不能在 Python 2.4/2.5 下執行.....看參與翻譯各位的了.

除了一些平台相關模組的指令碼, 所有例子都可以在 Windows, Solaris, 以及 Linux 下正常執行.

所有代碼都是有著作權的. 當然,你可以自由地使用這些這些模組,別忘記你是從哪得到(?學會)這些的.

大多例子的檔案名稱都包含它所使用的模組名稱,後邊是 "-example-" 以及一個唯一的"序號". 注意有些例子並不是按順序出現的, 這是為了匹配本書的較早版本 -(the eff-bot guide to) The Standard Python Library.

你可以在網上找到本書附帶CD的內容 (參閱 http://examples.oreilly.com/pythonsl). 更多資訊以及更新內容參閱http://www.pythonware.com/people/fredrik/librarybook.htm. (ft, 又一404. 大家一定不要看~) 0.4. 如何聯絡我們

Python 江湖 QQ 群: 43680167<

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.