没有合适的资源?快使用搜索试试~ 我知道了~
首页Foundations of Python Network Programming, 3rd Edition.pdf 英文原版. Python网络编程基础
Foundations of Python Network Programming, Third Edition, covers all of the classic topics found in the second edition of this book, including network protocols, network data and errors, email, server architecture, and HTTP and web applications, plus updates for Python 3. If you’re a Python programmer who needs a deep understanding of how to use Python for network-related tasks and applications, this is the book for you. From web application developers, to systems integrators, to system administratorsâthis book has everything that you need to know.
资源详情
资源评论
资源推荐

Rhodes
Goerzen
Shelve in
Programming Languages/General
User level:
Intermediate–Advanced
www.apress.com
SOURCE CODE ONLINE
BOOKS FOR PROFESSIONALS BY PROFESSIONALS
®
Foundations of Python Network
Programming
Foundations of Python Network Programming, Third Edition, covers all of the classic
topics found in the second edition of this book, including network protocols,
network data and errors, email, server architecture, and HTTP and web applications,
plus updates for Python 3.
Some of the new topics in this edition include:
• Extensive coverage of the updated SSL support in Python 3
• How to write your own asynchronous I/O loop
• An overview of the “asyncio” framework that comes with Python 3.4
• How the Flask web framework connects URLs to your Python code
• How cross-site scripting and cross-site request forgery can be used to
attack your web site, and how to protect against them
• How a full-stack web framework like Django can automate the round trip
from your database to the screen and back
• Updated coverage of network protocol layers and data encodings
If you’re a Python programmer who needs a deep understanding of how to use
Python for network-related tasks and applications, this is the book for you. From
web application developers, to systems integrators, to system administrators—
this book has everything that you need to know.
THIRD
EDITION
RELATED
9781430 258544
54999
ISBN 978-1-4302-5854-4
www.1024ebook.com

v
Contents at a Glance
About the Authors ������������������������������������������������������������������������������������������������������������� xvii
About the Technical Reviewers ����������������������������������������������������������������������������������������� xix
Acknowledgments ������������������������������������������������������������������������������������������������������������� xxi
Introduction ��������������������������������������������������������������������������������������������������������������������� xxiii
Chapter 1: Introduction to Client-Server Networking ■ ��������������������������������������������������������1
Chapter 2: UDP ■ ����������������������������������������������������������������������������������������������������������������17
Chapter 3: TCP ■ �����������������������������������������������������������������������������������������������������������������39
Chapter 4: Socket Names and DNS ■ ����������������������������������������������������������������������������������57
Chapter 5: Network Data and Network Errors ■ �����������������������������������������������������������������75
Chapter 6: TLS/SSL ■ ����������������������������������������������������������������������������������������������������������93
Chapter 7: Server Architecture ■ ��������������������������������������������������������������������������������������115
Chapter 8: Caches and Message Queues ■ �����������������������������������������������������������������������137
Chapter 9: HTTP Clients ■ �������������������������������������������������������������������������������������������������151
Chapter 10: HTTP Servers ■ ����������������������������������������������������������������������������������������������169
Chapter 11: The World Wide Web ■ ����������������������������������������������������������������������������������183
Chapter 12: Building and Parsing E-Mail ■ ����������������������������������������������������������������������223
Chapter 13: SMTP ■ ����������������������������������������������������������������������������������������������������������241
Chapter 14: POP ■ ������������������������������������������������������������������������������������������������������������259
Chapter 15: IMAP ■ �����������������������������������������������������������������������������������������������������������267
www.1024ebook.com

■ Contents at a GlanCe
vi
Chapter 16: Telnet and SSH ■ �������������������������������������������������������������������������������������������289
Chapter 17: FTP ■ �������������������������������������������������������������������������������������������������������������317
Chapter 18: RPC ■ �������������������������������������������������������������������������������������������������������������331
Index ���������������������������������������������������������������������������������������������������������������������������������349
www.1024ebook.com

xxiii
Introduction
It is an exciting moment for the Python community. After two decades of careful innovation that saw the language
gain features such as context managers, generators, and comprehensions in a careful balance with its focus on
remaining simple in both its syntax and its concepts, Python is nally taking o.
Instead of being seen as a boutique language that can be risked only by top-notch programming shops such
as Google and NASA, Python is now experiencing rapid adoption, both in traditional programming roles, such as
web application design, and in the vast world of “reluctant programmers,” such as scientists, data specialists, and
engineers—people who learn to program not for its own sake but because they must write programs if they are to
make progress in their eld. e benets that a simple programming language oers for the occasional or nonexpert
programmer cannot, I think, be overstated.
Python 3
After its debut in 2008, Python 3 went through a couple of years of reworking and streamlining before it was ready
to step into the role of its predecessor. But as it now enters its second half-decade, it has emerged as the preferred
platform for innovation in the Python community.
Whether one looks at fundamental improvements, like the fact that true Unicode text is now the default string
type in Python 3, or at individual improvements, like correct support for SSL, a built-in asyncio framework for
asynchronous programming, and tweaks to Standard Library modules large and small, the platform that Python 3
oers the network programmer is in nearly every way improved. is is a signicant achievement. Python 2 was
already one of the best languages for making programmers quickly and eectively productive on the modern Internet.
is book is not a comprehensive guide to switching from Python 2 to Python 3. It will not tell you how to add
parentheses to your old print statements, rename Standard Library module imports to their new names, or debug
deeply awed network code that relied on Python 2’s dangerous automatic conversion between byte strings and
Unicode strings—conversions that were always based on rough guesswork. ere are already excellent resources to
help you with that transition or even to help you write libraries carefully enough so that their code will work under
both Python 2 and Python 3, in case you need to support both audiences.
Instead, this book focuses on network programming, using Python 3 for every example script and snippet of code at
the Python prompt. ese examples are intended to build a comprehensive picture of how network clients, network servers,
and network tools can best be constructed from the tools provided by the language. Readers can study the transition from
Python 2 to Python 3 by comparing the scripts used in each chapter of the second edition of this book with the listings here
in the third edition—both of which are available at https://github.com/brandon-rhodes/fopnp/tree/m/ thanks to the
excellent Apress policy of making source code available online. e goal in each of the following chapters is simply to show
you how Python 3 can best be used to solve modern network programming problems.
By focusing squarely on how to accomplish things the right way with Python 3, this book hopes to prepare both
the programmer who is getting ready to write a new application from the ground up and the programmer preparing
to transition an old code base to the new conventions. Both programmers should come away knowing what correct
networking code looks like in Python 3 and therefore knowing the look and avor of the kind of code that ought to be
their goal.
www.1024ebook.com
剩余368页未读,继续阅读












安全验证
文档复制为VIP权益,开通VIP直接复制

评论0