没有合适的资源?快使用搜索试试~ 我知道了~
首页《Beginning Python:Using Python 2.6 and Python 3.1》-628页
《Beginning Python:Using Python 2.6 and Python 3.1》-628页
需积分: 5 0 下载量 22 浏览量
更新于2023-11-22
收藏 4.42MB PDF 举报
"Beginning Python: Using Python 2.6 and Python 3.1"是一本面向初学者的Python编程书籍。该书共有628页,主要介绍了Python 2.6和Python 3.1的使用方法。作者James Payne通过该书帮助读者更好地学习和理解Python编程语言。 在本书中,作者通过易于理解的语言和实例来详细介绍了Python的基本概念和语法。读者将学习如何安装和配置Python环境,并了解Python编程中的重要概念,如变量、运算符、条件语句、循环、函数和模块等。此外,还介绍了Python中的面向对象编程和异常处理的基本知识。 书中采用了一个渐进的教学方法,以便初学者能够逐步掌握Python编程。每个章节都包含丰富的练习和实例,帮助读者巩固所学知识并提高解决问题的能力。此外,书中还提供了一些实际项目,供读者实践应用所学知识。 除了书籍内容外,读者还可以通过Wrox的在线社区和论坛与其他Python编程爱好者交流。此外,读者还可以访问Wrox网站的在线图书馆,阅读和学习更多专业书籍。另外,Wrox还提供短信息和代码下载,帮助读者及时了解最新的编程技术和避免一些常见的问题。 总之,《Beginning Python: Using Python 2.6 and Python 3.1》是一本详尽介绍Python编程的入门书籍。透过该书的学习,读者将会取得对Python编程语言的基本掌握,并能够通过实践应用所学知识。无论是初学者还是有一定编程基础的读者,该书都能够帮助他们更好地理解和使用Python语言。
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/87853455/bg10.jpg)
![](https://csdnimg.cn/release/download_crawler_static/87853455/bg11.jpg)
Contents
Introduction xxvii
Part I: Dipping Your Toe into Python 1
Chapter 1: Programming Basics and Strings 3
How Programming is Different from Using a Computer 3
Programming is Consistency 4
Programming is Control 4
Programming Copes with Change 5
What All That Means Together 5
The First Steps 5
Installing Python 3.1 on Non-Windows Systems 6
Using the Python Shell 6
Beginning to Use Python — Strings 7
What is a String? 7
Why the Quotes? 7
Why Three Types of Quotes? 8
Using the print() Function 8
Understanding Different Quotes 9
Putting Two Strings Together 11
Joining Strings with the Print() Function 12
Putting Strings Together in Different Ways 12
Summary 13
Exercises 14
Chapter 2: Numbers and Operators 15
Different Kinds of Numbers 15
Numbers in Python 16
Program Files 18
Using the Different Types 19
Basic Math 21
Some Surprises 23
Using Numbers 24
Order of Evaluation 24
Number Formats 25
![](https://csdnimg.cn/release/download_crawler_static/87853455/bg12.jpg)
Contents
xvi
Mistakes Will Happen 26
Some Unusual Cases 27
Summary 28
Exercises 29
Chapter 3: Variables — Names for Values 31
Referring to Data — Using Names for Data 31
Changing Data Through Names 33
Copying Data 33
Names You Can’t Use and Some Rules 34
Using More Built-in Types 34
Tuples — Unchanging Sequences of Data 34
Lists — Changeable Sequences of Data 37
Dictionaries — Groupings of Data Indexed by Name 39
Treating a String Like a List 41
Special Types 42
Other Common Sequence Properties 43
Referencing the Last Elements 43
Ranges of Sequences 44
Growing Lists by Appending Sequences 45
Using Lists to Temporarily Store Data 45
Working with Sets 46
Summary 47
Exercises 48
Part II: Python Language and the Standard Library 49
Chapter 4: Making Decisions 51
Comparing Values — Are They the Same? 51
Doing the Opposite — Not Equal 53
Comparing Values — Which One Is More? 54
More Than or Equal, Less Than or Equal 55
Reversing True and False 56
Looking for the Results of More Than One Comparison 56
How to Get Decisions Made 57
Repetition 60
How to Do Something — Again and Again 60
Stopping the Repetition 62
Handling Errors 65
Trying Things Out 65
![](https://csdnimg.cn/release/download_crawler_static/87853455/bg13.jpg)
Contents
xvii
Summary 67
Exercises 69
Chapter 5: Functions 71
Putting Your Program into Its Own File 71
Functions: Grouping Code under a Name 73
Choosing a Name 75
Describing a Function in the Function 75
The Same Name in Two Different Places 76
Making Notes to Yourself 78
Asking a Function to Use a Value You Provide 79
Checking Your Parameters 81
Setting a Default Value for a Parameter—Just in Case 83
Calling Functions from within Other Functions 84
Functions Inside of Functions 86
Flagging an Error on Your Own Terms 87
Layers of Functions 88
How to Read Deeper Errors 88
Summary 89
Exercises 90
Chapter 6: Classes and Objects 93
Thinking About Programming 93
What is an Object? 93
Objects You Already Know 94
Looking Ahead: How You Want to Use Objects 95
Defining a Class 96
How Code Can Be Made into an Object 96
Objects and Their Scope 104
Summary 107
Exercises 108
Chapter 7: Organizing Programs 111
Modules 112
Importing a Module So That You Can Use It 112
Making a Module from Pre-existing Code 113
Using Modules — Starting with the Command Line 115
Changing How Import Works — Bringing in More 118
Packages 118
![](https://csdnimg.cn/release/download_crawler_static/87853455/bg14.jpg)
Contents
xviii
Modules and Packages 120
Bringing Everything into the Current Scope 120
Re-importing Modules and Packages 121
Basics of Testing Your Modules and Packages 124
Summary 124
Exercises 125
Chapter 8: Files and Directories 127
File Objects 127
Writing Text Files 128
Appending Text to a File 129
Reading Text Files 130
File Exceptions 131
Paths and Directories 131
Exceptions in os
132
Paths 132
Directory Contents 135
Obtaining Information about Files 136
Renaming, Moving, Copying, and Removing Files 137
Example: Rotating Files 138
Creating and Removing Directories 140
Globbing 140
Summary 142
Exercises 142
Chapter 9: Other Features of the Language 143
Lambda and Filter: Short Anonymous Functions 143
Map: Short-Circuiting Loops 144
Decisions within Lists — List Comprehension 145
Generating Iterators for Loops 146
Special String Substitution Using Dictionaries 148
Featured Modules 149
Getopt — Getting Options from the Command Line 149
Using More Than One Process 152
Threads — Doing Many Things in the Same Process 154
Summary 156
Exercises 156
剩余627页未读,继续阅读
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/28105908048e4518a28a3457cdef3389_weixin_40191861.jpg!1)
weixin_40191861_zj
- 粉丝: 67
- 资源: 1万+
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
会员权益专享
最新资源
- 京瓷TASKalfa系列维修手册:安全与操作指南
- 小波变换在视频压缩中的应用
- Microsoft OfficeXP详解:WordXP、ExcelXP和PowerPointXP
- 雀巢在线媒介投放策划:门户网站与广告效果分析
- 用友NC-V56供应链功能升级详解(84页)
- 计算机病毒与防御策略探索
- 企业网NAT技术实践:2022年部署互联网出口策略
- 软件测试面试必备:概念、原则与常见问题解析
- 2022年Windows IIS服务器内外网配置详解与Serv-U FTP服务器安装
- 中国联通:企业级ICT转型与创新实践
- C#图形图像编程深入解析:GDI+与多媒体应用
- Xilinx AXI Interconnect v2.1用户指南
- DIY编程电缆全攻略:接口类型与自制指南
- 电脑维护与硬盘数据恢复指南
- 计算机网络技术专业剖析:人才培养与改革
- 量化多因子指数增强策略:微观视角的实证分析
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)