Mastering Perl
Mastering Perl 是perl经典系列之三。适合有一定基础的人使用。
Intermediate Perl
perl经典系列三部曲之二。
其他两边书分别为:Learning Perl, Mastering Perl。
Learning Perl Fifth Edition
Perl语言入门(第五版),这本书是英文版,目前还没有中文版。是perl经典系列三部曲之一。
其他两边书分别为:Intermediate Perl, Mastering Perl。这三本书由易到难,大家可以选择适合自己的进行阅读。
LP102考试准备教程
LP102考试准备教程,很详细的教程,是了解考试内容和考试强度的好资料。
LP101考试准备教程
LP101考试准备教程,很详细的教程,是了解考试内容和考试强度的好资料。
Perl-Tidy-20090616
perl很好的代码格式化工具.使用该工具可以把自己编写的perl代码调整为更好的格式.
具体使用详见http://perltidy.sourceforge.net
pdg 阅读器--用于阅读pdg文档
pdg阅读器可以用于阅读pdg格式的文档.无需安装,直接使用.
ExamDiffPro
ExamDiffPro可以检测出两个指定的文件夹或文件中哪些内容不同.
Perl编程语言.pdf
好像是中文第三版吧。
小骆驼,中文。
学习Perl的入门书籍。
Python 学习笔记
Python 学习笔记,中文版
适合初学者
Python 中文手册
Abstract
Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple
but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its
interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most
platforms. Python
是一种容易学习的强大语言。它包括了高效的高级数据结构,提供了一个简单但很有效的方式进行面向对
象编程。Python 优雅的语法,动态类型,以及它天然的解释能力,使其成为了大多数平台上应用于各领域
理想的脚本语言以及开发环境。
The Python interpreter and the extensive standard library are freely available in source or binary form for all major
platforms from the Python Web site, http://www.python.org/, and can be freely distributed. The same site also contains
distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation.
Python 解释器及其扩展标准库的源码和编译版本可以从Python 的Web 站点, http://www.python.org/, 及其所有
镜像站上免费获得,并且可以自由发布。该站点上也提供了Python 的一些第三方模块,程序,工具,以及
附加的文档。
The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other
languages callable from C). Python is also suitable as an extension language for customizable applications.
Python 的解释器很容易通过C 或C++ (或者其它可以由C来调用的语言)来扩展新的函数和数据结构。因
此Python 也很适于作为定制应用的一种扩展语言。
This tutorial introduces the reader informally to the basic concepts and features of the Python language and system. It
helps to have a Python interpreter handy for hands-on experience, but all examples are self-contained, so the tutorial
can be read off-line as well.
这个手册介绍了一些Python 语言及其系统的基本知识与概念。这有助于读者对Python 有一个基本的认识,
当然所有的例子都已包括在文中,所以这本手册很适合离线阅读。
For a description of standard objects and modules, see the Python Library Reference document. The Python Reference
Manual gives a more formal definition of the language. To write extensions in C or C++, read Extending and
Embedding the Python Interpreter and Python/C API Reference. There are also several books covering Python in
depth.
需要有关标准对象和模块的详细介绍的话,请查询Python 库参考手册文档。Python 参考手册提供了更多的
关于语言方面的正式说明。需要编写C或C++扩展,请阅读Python 解释器的扩展和集成以及Python/C API 参
考手册。这几本书涵盖了各个深度上的Python知识。
This tutorial does not attempt to be comprehensive and cover every single feature, or even every commonly used
feature. Instead, it introduces many of Python’s most noteworthy features, and will give you a good idea of the
language’s flavor and style. After reading it, you will be able to read and write Python modules and programs, and you
will be ready to learn more about the various Python library modules described in the Python Library Reference.
本手册不会涵盖Python 的所有功能,也不会去解释所用到的所有相关的知识。相反,它介绍了许多Python
中最引人注目的功能,这会对读者掌握这门语言的风格大有帮助。读过它后,你应该可以阅读和编写Python
模块和程序,接下来可以从Python 库参考手册中进一步学习Python复杂多变的库和模块。
Dive Into Python 中文版
目录
第 1 章 安装 Python........................................................................................................................................7
1.1. 哪一种 Python 适合您? .....................................................................................................................7
1.2. Windows 上的 Python.........................................................................................................................7
1.3. Mac OS X 上的 Python ........................................................................................................................9
1.4. Mac OS 9 上的 Python .......................................................................................................................10
1.5. RedHat Linux 上的 Python ..............................................................................................................11
1.6. Debian GNU/Linux 上的 Python ...................................................................................................11
1.7. 从源代码安装 Python ........................................................................................................................12
1
1.8. 使用 Python 的交互 Shell .................................................................................................................13
1.9. 小结 .....................................................................................................................................................13
第 2 章 第一个 Python 程序 .........................................................................................................................14
2.1. 概览 .....................................................................................................................................................14
2.2. 函数声明 .............................................................................................................................................15
2.3. 文档化函数 .........................................................................................................................................16
2.4. 万物皆对象 .........................................................................................................................................16
2.5. 代码缩进 .............................................................................................................................................18
2.6. 测试模块 .............................................................................................................................................20
第 3 章 内置数据类型 ...................................................................................................................................21
3.1. Dictionary 介绍 .................................................................................................................................21
3.2. List 介绍 ..............................................................................................................................................23
3.3. Tuple 介绍 ..........................................................................................................................................28
3.4. 变量声明 .............................................................................................................................................30
3.5. 格式化字符串 .....................................................................................................................................32
3.6. 映射 list ...............................................................................................................................................33
3.7. 连接 list 与分割字符串 ......................................................................................................................35
3.8. 小结 .....................................................................................................................................................37
第 4 章 自省的威力 .......................................................................................................................................38
4.1. 概览 .....................................................................................................................................................38
4.2. 使用可选参数和命名参数 .................................................................................................................39
4.3. 使用 type、str、dir 和其它内置函数 ..............................................................................................40
4.4. 通过 getattr 获取对象引用 ................................................................................................................43
4.5. 过滤列表 .............................................................................................................................................46
4.6. and 和 or 的特殊性质 ........................................................................................................................47
4.7. 使用 lambda 函数 ..............................................................................................................................49
4.8. 全部放在一起 .....................................................................................................................................51
4.9. 小结 .....................................................................................................................................................54
第 5 章 对象和面向对象 ...............................................................................................................................55
5.1. 概览 .....................................................................................................................................................55
5.2. 使用 from module import 导入模块 ...............................................................................................57
5.3. 类的定义 .............................................................................................................................................59
5.4. 类的实例化 .........................................................................................................................................61
5.5. 探索 UserDict:一个封装类 .............................................................................................................63
5.6. 专用类方法 .........................................................................................................................................66
5.7. 高级专用类方法 .................................................................................................................................69
5.8. 类属性介绍 .........................................................................................................................................70
2
5.9. 私有函数 .............................................................................................................................................72
5.10. 小结 ...................................................................................................................................................73
第 6 章 异常和文件处理 ...............................................................................................................................74
6.1. 异常处理 .............................................................................................................................................74
6.2. 与文件对象共事 .................................................................................................................................77
6.3. for 循环 ...............................................................................................................................................81
6.4. 使用 sys.modules...............................................................................................................................83
6.5. 与目录共事 .........................................................................................................................................85
6.6. 全部放在一起 .....................................................................................................................................89
6.7. 小结 .....................................................................................................................................................90
第 7 章 正则表达式 .......................................................................................................................................93
7.1. 概览 .....................................................................................................................................................93
7.2. 个案研究:街道地址 ..........................................................................................................................93
7.3. 个案研究:罗马字母 ..........................................................................................................................95
7.4. 使用 {n,m} 语法 .................................................................................................................................98
7.5. 松散正则表达式 ...............................................................................................................................101
7.6. 个案研究:解析电话号码 ...............................................................................................................102
7.7. 小结 ...................................................................................................................................................107
第 8 章 HTML 处理 ....................................................................................................................................108
8.1. 概览 ...................................................................................................................................................108
8.2. sgmllib.py 介绍 ...............................................................................................................................113
8.3. 从 HTML 文档中提取数据 .............................................................................................................116
8.4. BaseHTMLProcessor.py 介绍 ........................................................................................................118
8.5. locals 和 globals................................................................................................................................120
8.6. 基于 dictionary 的字符串格式化 ...................................................................................................124
8.7. 给属性值加引号 ...............................................................................................................................125
8.8. dialect.py 介绍 .................................................................................................................................126
8.9. 全部放在一起 ...................................................................................................................................129
8.10. 小结 .................................................................................................................................................131
第 9 章 XML 处理 .......................................................................................................................................133
9.1. 概览 ...................................................................................................................................................133
9.2. 包 .......................................................................................................................................................140
9.3. XML 解析 .........................................................................................................................................142
9.4. Unicode .............................................................................................................................................145
9.5. 搜索元素 ...........................................................................................................................................149
9.6. 访问元素属性 ...................................................................................................................................151
9.7. Segue [9]............................................................................................................................................152
第 10 章 脚本和流 .......................................................................................................................................154
3
10.1. 抽象输入源 .....................................................................................................................................154
10.2. 标准输入、输出和错误 .................................................................................................................158
10.3. 查询缓冲节点 .................................................................................................................................162
10.4. 查找节点的直接子节点 .................................................................................................................163
10.5. 根据节点类型创建不同的处理器 .................................................................................................164
10.6. 处理命令行参数 ..............................................................................................................................166
10.7. 全部放在一起 .................................................................................................................................169
10.8. 小结 .................................................................................................................................................171
第 11 章 HTTP Web 服务 ...........................................................................................................................172
11.1. 概览 .................................................................................................................................................172
11.2. 避免通过 HTTP 重复地获取数据 ................................................................................................174
11.3. HTTP 的特性 .................................................................................................................................175
11.4. 调试 HTTP web 服务 .....................................................................................................................177
11.5. 设置 User-Agent.............................................................................................................................178
11.6. 处理 Last-Modified 和 ETag..........................................................................................................180
11.7. 处理重定向 .....................................................................................................................................183
11.8. 处理压缩数据 .................................................................................................................................187
11.9. 全部放在一起 .................................................................................................................................190
11.10. 小结 ...............................................................................................................................................192
第 12 章 SOAP Web 服务 ...........................................................................................................................193
12.1. 概览 .................................................................................................................................................193
12.2. 安装 SOAP 库 ................................................................................................................................194
12.3. 步入 SOAP......................................................................................................................................196
12.4. SOAP 网络服务查错 .....................................................................................................................197
12.5. WSDL 介绍 .....................................................................................................................................199
12.6. 以 WSDL 进行 SOAP 内省 ...........................................................................................................200
12.7. 搜索 Google ...................................................................................................................................202
12.8. SOAP 网络服务故障排除 .............................................................................................................205
12.9. 小结 .................................................................................................................................................209
第 13 章 单元测试 .......................................................................................................................................210
13.1. 罗马数字程序介绍 II ......................................................................................................................210
13.2. 深入 .................................................................................................................................................211
13.3. romantest.py 介绍 ..........................................................................................................................211
13.4. 正面测试 (Testing for success) .....................................................................................................215
13.5. 负面测试 (Testing for failure) .......................................................................................................217
13.6. 完备性检测 (Testing for sanity) ...................................................................................................219
第 14 章 测试优先编程 ...............................................................................................................................222
4
14.1. roman.py, 第 1 阶段 .......................................................................................................................222
14.2. roman.py, 第 2 阶段 .......................................................................................................................225
14.3. roman.py, 第 3 阶段 .......................................................................................................................229
14.4. roman.py, 第 4 阶段 .......................................................................................................................233
14.5. roman.py, 第 5 阶段 .......................................................................................................................235
第 15 章 重构 ...............................................................................................................................................239
15.1. 处理 bugs ........................................................................................................................................239
15.2. 应对需求变化 .................................................................................................................................241
15.3. 重构 .................................................................................................................................................248
15.4. 后记 .................................................................................................................................................252
15.5. 小结 .................................................................................................................................................254
第 16 章 函数编程 .......................................................................................................................................256
16.1. 概览 .................................................................................................................................................256
16.2. 找到路径 .........................................................................................................................................257
16.3. 重识列表过滤 .................................................................................................................................260
16.4. 重识列表映射 .................................................................................................................................261
16.5. 数据中心思想编程 ..........................................................................................................................263
16.6. 动态导入模块 .................................................................................................................................264
16.7. 全部放在一起 .................................................................................................................................265
16.8. 小结 .................................................................................................................................................268
第 17 章 动态函数 .......................................................................................................................................269
17.1. 概览 .................................................................................................................................................269
17.2. plural.py, 第 1 阶段 ........................................................................................................................269
17.3. plural.py, 第 2 阶段 ........................................................................................................................272
17.4. plural.py, 第 3 阶段 ........................................................................................................................273
17.5. plural.py, 第 4 阶段 ........................................................................................................................274
17.6. plural.py, 第 5 阶段 ........................................................................................................................277
17.7. plural.py, 第 6 阶段 ........................................................................................................................278
17.8. 小结 .................................................................................................................................................281
第 18 章 性能优化 .......................................................................................................................................283
18.1. 概览 .................................................................................................................................................283
18.2. 使用 timeit 模块 .............................................................................................................................285
18.3. 优化正则表达式 ..............................................................................................................................287
18.4. 优化字典查找 .................................................................................................................................290
18.5. 优化列表操作 .................................................................................................................................293
18.6. 优化字符串操作 ..............................................................................................................................295
18.7. 小结 .................................................................................................................................................297
5
附录 A. 进一步阅读 ....................................................................................................................................298
附录 B. 五分钟回顾 .....................................................................................................................................303
附录 C. 技巧和窍门 ....................................................................................................................................319
附录 D. 示例清单 ........................................................................................................................................329
附录 E. 修订历史 .........................................................................................................................................344
附录 F. 关于本书 .........................................................................................................................................360
附录 G. GNU Free Documentation License .............................................................................................361
G.0. Preamble ..........................................................................................................................................361
G.1. Applicability and definitions ........................................................................................................361
G.2. Verbatim copying ............................................................................................................................362
G.3. Copying in quantity ........................................................................................................................362
G.4. Modifications ..................................................................................................................................363
G.5. Combining documents ...................................................................................................................364
G.6. Collections of documents ...............................................................................................................364
G.7. Aggregation with independent works .........................................................................................365
G.8. Translation ......................................................................................................................................365
G.9. Termination .....................................................................................................................................365
G.10. Future revisions of this license ....................................................................................................365
G.11. How to use this License for your documents ...........................................................................365
附录 H. GNU 自由文档协议 ......................................................................................................................367
H.0. 序 ......................................................................................................................................................367
H.1. 适用范围和定义 ..............................................................................................................................367
H.2. 原样复制 ..........................................................................................................................................368
H.3. 大量复制 ..........................................................................................................................................368
H.4. 修改 ..................................................................................................................................................369
H.5. 合并文档 ..........................................................................................................................................370
H.6. 文档合集 ..........................................................................................................................................370
H.7. 独立著作聚集 .................................................................................................................................370
H.8. 翻译 ..................................................................................................................................................371
H.9. 终止协议 ..........................................................................................................................................371
H.10. 协议将来的修订 ............................................................................................................................371
H.11. 如何为你的文档使用本协议 ........................................................................................................371
附录 I. Python license .................................................................................................................................373
I.A. History of the software ...................................................................................................................373
I.B. Terms and conditions for accessing or otherwise using Python ...............................................373
附录 J. Python 协议 ....................................................................................................................................377
J.0. 关于译文的声明 ...............................................................................................................................377
J.A. 软件的历史 ......................................................................................................................................377
J.B. 使用 Python 的条款和条件 .............................................................................................................377
pyinstaller-1.3
pyinstaller, version is 1.3.