SPECIAL OFFERS
Keep up with new releases and promotions. Sign up to hear from us.
Rough Cuts are manuscripts that are developed but not yet published, available through Safari. Rough Cuts provide you access to the very latest information on a given topic and offer you the opportunity to interact with the author to influence the final publication.
This is the Rough Cut version of the printed book.
Python is an agile, robust, and expressive programming language that continues to build momentum. It combines the power of compiled languages with the simplicity and rapid development of scripting languages. In Core Python Applications Programming, Third Edition, leading Python developer and corporate trainer Wesley Chun helps you take your Python knowledge to the next level.
This book has everything you need to become a versatile Python developer. You will be introduced to multiple areas of application development and gain knowledge that can be immediately applied to projects, and you will find code samples in both Python 2 and 3, including migration tips if that’s on your roadmap too. Some snippets will even run unmodified on 2.x or 3.x.
Core Python Applications Programming, Third Edition, delivers
Preface xv
Acknowledgments xxvii
About the Author xxxi
Part I: General Application Topics 1
Chapter 1: Regular Expressions 2
1.1 Introduction/Motivation 3
1.2 Special Symbols and Characters 6
1.3 Regexes and Python 16
1.4 Some Regex Examples 36
1.5 A Longer Regex Example 41
1.6 Exercises 48
Chapter 2: Network Programming 53
2.1 Introduction 54
2.2 What Is Client/Server Architecture? 54
2.3 Sockets: Communication Endpoints 58
2.4 Network Programming in Python 61
2.5 The SocketServer Module 79
2.6 Introduction to the Twisted Framework 84
2.7 Related Modules 88
2.8 Exercises 89
Chapter 3: Internet Client Programming 94
3.1 What Are Internet Clients? 95
3.2 Transferring Files 96
3.3 Network News 104
3.4 E-Mail 114
3.5 Related Modules 146
3.6 Exercises 148
Chapter 4: Multithreaded Programming 156
4.1 Introduction/Motivation 157
4.2 Threads and Processes 158
4.3 Threads and Python 160
4.4 The thread Module 164
4.5 The threading Module 169
4.6 Comparing Single vs. Multithreaded Execution 180
4.7 Multithreading in Practice 182
4.8 Producer-Consumer Problem and the Queue/queue Module 202
4.9 Alternative Considerations to Threads 206
4.10 Related Modules 209
4.11 Exercises 210
Chapter 5: GUI Programming 213
5.1 Introduction 214
5.2 Tkinter and Python Programming 216
5.3 Tkinter Examples 221
5.4 A Brief Tour of Other GUIs 236
5.5 Related Modules and Other GUIs 247
5.6 Exercises 250
Chapter 6: Database Programming 253
6.1 Introduction 254
6.2 The Python DB