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

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

by Bill Lubanovic
March 2022
Intermediate to advanced content levelIntermediate to advanced
522 pages
13h 52m
Chinese
Posts & Telecom Press
Content preview from Python语言及其应用(第2版)
346
19
19.2
寻找
Python
代码
如果你需要编写一些代码,那么最快的办法就是从经过许可的源代码中去“偷”。
Python
标准库兼具广度和深度,而且条理清晰。到库中探宝吧。
就像各类运动的名人堂一样,某个模块要想进入标准库,那可不是一朝一夕的事。标准库
之外的各种新包层出不穷,本书中着重介绍的那些包,要么解决了新问题,要么改进了旧
方法。
Python
的宣传口号是
自备电池
,但你可能需要一种新电池。
那么,除了标准库,应该到哪儿去找优秀的
Python
代码呢?
第一个站点是
Python
Package Index
PyPI
)。它的前身是以巨蟒剧团的话剧短剧命名的
Cheese Shop
,该站点持续更新
Python
,在我撰写本书之际,已经有
113 000
多个包了。
当你使用
pip
时(参见下一节),它会搜索
PyPI
PyPI
的主页展示了新近添加的
Python
包。也可以在主页中央的搜索框内输入要查找的内容。例如,搜索
genealogy
会产生
21
匹配结果,搜索
movies
则会产生
528
个匹配结果。
另一个流行的站点是
GitHub
仓库。可以从中查看
Python
包的当前趋势。
Popular Python Recipes
包含了超过
4000
个短小的
Python
程序,涉及各种主题。
19.3
安装
Python
安装
Python
包的方法有很多种。
使用
pip
(如果可以的话)。这是目前最常见的方法。可以通过
pip
安装大多数的
Python
包。
使用结合了
pip
virtualenv
pipenv
• ...
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