Skip to Content
Python语言及其应用(第2版)
book

Python语言及其应用(第2版)

by Bill Lubanovic
March 2022
Intermediate to advanced
522 pages
13h 52m
Chinese
Posts & Telecom Press
Content preview from Python语言及其应用(第2版)
184
11
11.4
获取其他
Python
代码
有时候,标准库中并没有你想要的东西,或是无法很好地满足需求。没关系,还有开源世
界和第三方
Python
软件。以下是一些不错的资源。
PyPi
(也称为
Cheese Shop
,得名自滑稽短剧《巨蟒剧团》
GitHub
readthedocs
可以在
activestate
中找到很多短小的
Python
代码示例。
本书大部分
Python
码是使用标准
Python
安装的,其中包括全部的内建函数和标准库。
外部包在部分章节有所涉及:第
1
章提到过
request
,更多细节参见第
18
章。附录
B
展示
了如何安装第三方
Python
软件,以及许多其他具体的开发细节。
11.5
后续内容
12
章将进入实战环节,其中涵盖了
Python
数据操作的诸多方面。你会碰到
bytes
bytearray
数据类型,处理文本字符串中的
Unicode
字符,以及使用正则表达式搜索文本字
符串。
11.6
练习
1.
创建文件
zoo.py
。先在其中定义函数
hours()
,打印出字符串
'Open 9-5 daily'
。然后
使用交互式解释器导入
zoo
模块并调用
hours()
函数。
2.
在交互式解释器中,把
zoo
模块作为
menagerie
导入并调用其
hours()
函数。
3.
在交互式解释器中直接从
zoo
导入
hours()
函数并调用。
4.
hours()
函数作为
info
导入并调用。
5.
使用“键
值”对
'a': 1
'b': 2
'c': 3
创建字典
plain
,然后打印出该字典。
6. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python编程入门与实战

Python编程入门与实战

Posts & Telecom Press, Fabrizio Romano
Python实用技能学习指南

Python实用技能学习指南

Posts & Telecom Press, Robert Smallshire, Austin Bingham
Python技术基础视频教程

Python技术基础视频教程

保罗·J·戴特尔
Python面向对象编程指南

Python面向对象编程指南

Posts & Telecom Press, Steven F. Lott

Publisher Resources

ISBN: 9787115586223