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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

可编程网络自动化

可编程网络自动化

Jason Edelman, Scott S. Lowe, Matt Oswalt
Python实用技能学习指南

Python实用技能学习指南

Posts & Telecom Press, Robert Smallshire, Austin Bingham
量子计算机编程:从入门到实践

量子计算机编程:从入门到实践

Eric R. Johnston, Nicholas Harrigan, Mercedes Gimeno-Segovia
Python编程入门与实战

Python编程入门与实战

Posts & Telecom Press, Fabrizio Romano

Publisher Resources

ISBN: 9787115586223