python库参考手册

上传人:xzh****18 文档编号:44562469 上传时间:2018-06-14 格式:PDF 页数:45 大小:92.02KB
返回 下载 相关 举报
python库参考手册_第1页
第1页 / 共45页
python库参考手册_第2页
第2页 / 共45页
python库参考手册_第3页
第3页 / 共45页
python库参考手册_第4页
第4页 / 共45页
python库参考手册_第5页
第5页 / 共45页
点击查看更多>>
资源描述

《python库参考手册》由会员分享,可在线阅读,更多相关《python库参考手册(45页珍藏版)》请在金锄头文库上搜索。

1、Python库参考手册(Python Library Reference)Release 2.3.3Guido van Rossum Fred L. Drake, Jr., editor 翻译团队: 见文末名单译文最后修改: 2004年3月22日PythonLabs Email:docspython.orgCopyright c ? 2001, 2002, 2003 Python Software Foundation. All rights reserved.Copyright c ? 2000 BeO. All rights reserved.Copyright c ? 1995-2000

2、 Corporation for National Research Initiatives. All rights reserved.Copyright c ? 1991-1995 Stichting Mathematisch Centrum. All rights reserved.See the end of this document for complete license and permissions information.详细版权及使用许可的资料见本文的最后部份.Python is an extensible, interpreted, object-oriented pro

3、gramming language. It supports a wide range of applica- tions, from simple text processing scripts to interactive Web browsers.Python 是一种可扩展的, 即译式, 面向对象规格的编程语言. 它能应用在极广泛的地方, 从简单的文字处理 工作到交互式的网页浏览器.While the Python Reference Manual describes the exact syntax and semantics of the language, it does not

4、describe the standard library that is distributed with the language, and which greatly enhances its immediate usability.This library contains built-in modules (written in C) that provide access to system functionality such as file I/O that would otherwise be inaccessible to Python programmers, as we

5、ll as modules written in Python that provide standardized solutions for many problems that occur in everyday programming. Some of these modules are explicitly designed to encourage and enhance the portability of Python programs.Python语言参考手册中精确地描述了Python 语言的句法及语义. 然而语言参考手册中没有提到Python 所 附带功能强大的标准库. 这个

6、函式库大大地增强了Python 的实用性. 其中包括C 写的内建模组, 提供介面 让程式进行操作系统层次的工作, 例如档案的输出输入; 同时也有以Python 语言本身编写的模组, 为实际 编程时常遇的问题提供标准解决方案. 这类模组有的经过特别设计以便Python 程式在跨平台的情况下运 行无误.This library reference manual documents Pythons standard library, as well as many optional library modules (which may or may not be available, dependi

7、ng on whether the underlying platform supports them and on theconfiguration choices made at compile time). It also documents the standard types of the language and its built-in functions and exceptions, many of which are not or incompletely documented in the Reference Manual.本参考手册罗列并说明了Python 标准库的各种

8、功能, 以及许多非核心的模组(按不同的操作系统和编译时 的设置而定, 不是每台机上的Python 都能用这些模组.) 本手册同时记载了Python 语言所有的标准数据类 型, 内建函数, 异常类, 这些在参考手册中被忽略了或只是扼要的提过一下.This manual assumes basic knowledge about the Python language. For an informal introduction to Python, see the Python Tutorial; the Python Reference Manual remains the highest au

9、thority on syntactic and semantic questions. Finally, the manual entitled Extending and Embedding the Python Interpreter describes how to add new extensions to Python and how to embed it in other applications.本手册的读者要对Python 有基本的认识. 初学者应该从Python指南开始. 至于Python语言参考手册则是 该语言的语法和语义问题上的权威阐释. 最后扩展或嵌入Python解

10、释器一文解说了如何在Python 中加入 新的扩展模组; 以及怎样把Python 解释器嵌入到其他的应用程式中.目录第第第一一一章章章内内内建建建对对对象象象Built-In Objects1第第第二二二章章章Python运运运行行行时时时服服服务务务Python Runtime Services3 2.1main 顶层脚本的运行环境Top-level script environment. . . . . . . . . . . . . . . .3第第第三三三章章章其其其他他他各各各类类类服服服务务务Miscellaneous Services5第第第四四四章章章普普普遍遍遍的的的操操操作

11、作作系系系统统统服服服务务务Generic Operating System Services7第第第五五五章章章可可可选选选配配配的的的操操操作作作系系系统统统服服服务务务Optional Operating System Services9第第第六六六章章章互互互联联联网网网通通通讯讯讯协协协议议议及及及其其其支支支援援援Internet Protocols and Support11第第第七七七章章章互互互联联联网网网资资资料料料处处处理理理Internet Data Handling13 7.1base64 编码和解码MIME Base64数据Encode and decode MIM

12、E base64 data . . . . . . .13 7.2xml.dom The Document Object Model 文档对象模式API. . . . . . . . . . . . . . . . . .14第第第八八八章章章多多多媒媒媒体体体服服服务务务Multimedia Services25第第第九九九章章章加加加密密密服服服务务务Cryptographic Services27第第第十十十章章章Python 语语语言言言服服服务务务Python Language Services29第第第十十十一一一章章章SGI IRIX 特特特定定定服服服务务务SGI IRIX S

13、pecific Services31 11.1al SGI 的音讯功能Audio functions on the SGI . . . . . . . . . . . . . . . . . . . . . . . . .31 11.2AL al 模组中用到的常数。Constants used with the al module . . . . . . . . . . . . . . . .33第第第十十十二二二章章章SunOS 特特特定定定服服服务务务SunOS Specific Services35第第第十十十三三三章章章MS Windows 有有有关关关的的的服服服务务务MS Wind

14、ows Services37附附附录录录 A翻翻翻译译译团团团队队队39iii第第第一一一章章章内内内建建建对对对象象象Built-In ObjectsNames for built-in exceptions and functions and a number of constants are found in a separate symbol table. Thistable is searched last when the interpreter looks up the meaning of a name, so local and global user-defined nam

15、es can override built-in names. Built-in types are described together here for easy reference.1内建的异常、函数和一组常量的名字都能在一个独立的符号表中找到。当解释器在查找一个名字的意义 的时候,这个表格是被最后查找的,所以局部的和全局的用户定义的名字可以覆盖内建的名字。所有的 内建类型都统一在本章描述,作为一个简单的参考。2The tables in this chapter document the priorities of operators by listing them in order

16、of ascending priority (within a table) and grouping operators that have the same priority in the same box. Binary operators of the same priority group from left to right. (Unary operators group from right to left, but there you have no real choice.) See chapter 5 of the Python Reference Manual for the complete picture on operator priorities.在本章的表格中,对于操作符的优先级,以它们在表格中列出的顺序,升序排列,(在同一个表格中) 并且把相同优先级的操作符组织在同一格当中。同一优先级的二元操作符已从左到右的顺序结合。(一 元操作符从右到左结合,但事实上,你并没有选择的余地。) 对于操作符优先级的一个整体印象参 见P

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 理论文章

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号