Java知识分享网 - 轻松学习从此开始!    

Java知识分享网

Java1234官方群25:java1234官方群17
Java1234官方群25:838462530
        
SpringBoot+SpringSecurity+Vue+ElementPlus权限系统实战课程 震撼发布        

最新Java全栈就业实战课程(免费)

springcloud分布式电商秒杀实战课程

IDEA永久激活

66套java实战课程无套路领取

锋哥开始收Java学员啦!

Python学习路线图

锋哥开始收Java学员啦!
当前位置: 主页 > Java文档 > Java基础相关 >

Foundations of Python 3 Network Programming, Second Edition PDF 下载


分享到:
时间:2023-08-31 10:53来源:http://www.java1234.com 作者:转载  侵权举报
Foundations of Python 3 Network Programming, Second Edition
失效链接处理
Foundations of Python 3 Network Programming, Second Edition PDF 下载 



 
 
相关截图:
 

主要内容:

In many cases, network programming simply involves selecting and using a library that already
supports the network operations you need to perform. A major purpose of this book is to introduce you
to all of the key networking libraries available for Python, and to teach you about the lower-level network
services on which those libraries are built—both so that you understand how the libraries work, and so
that you will understand what is happening when something at a lower level goes wrong.
Let’s begin with a very simple example. I have here a mailing address, which looks like this:
207 N. Defiance St
Archbold, OH
And I am interested in knowing the latitude and longitude of this physical address. It just so
happens that Google provides a “Maps API” that can perform such a conversion. What would I have to
do to take advantage of this network service from Python?
When looking at a new network service that you want to use, it is always worthwhile to start by
finding out whether someone has already implemented the protocol—in this case, the Google Maps
protocol—that your program will need to speak. Start by scrolling through the Python Standard Library
documentation, looking for anything having to do with Google Maps:
http://docs.python.org/library/
Do you see anything? No, neither do I. But it is important for a Python programmer to look through
the Standard Library’s table of contents pretty frequently, even if you usually do not find what you are
looking for, because each reading will make you more familiar with the services that do come included
with Python.
Since the Standard Library does not have a package to help us, we can turn to the Python Package
Index, an excellent resource for finding all sorts of general-purpose Python packages contributed by
other programmers and organizations from across the world. You can also, of course, check the web site
of the vendor whose service you will be using to see whether they provide a python library to access it.
Or you can do a general Google search for “Python” plus the name of whatever web service you want to
use, and see whether any of the first few results link to a package that you might want to try.
In this case, I searched the Python Package Index, which lives at this URL:
http://pypi.python.org/
There, I did a search for Google maps, and immediately found a package that is actually named
googlemaps and that provides a clean interface to its features (though, you will note from its description,
it is not vendor-provided, but was instead written by someone besides Google):
http://pypi.python.org/pypi/googlemaps/
This is such a common situation—that you find a Python package that sounds like it might already
do exactly what you want, and that you want to try it out on your system—that we should pause for a
moment and introduce you to the very best Python technology for quickly trying out a new library:
virtualenv!
In the old days, installing a Python package was a gruesome and irreversible act that required
administrative privileges on your machine and left your system Python install permanently altered. After
several months of heavy Python development, your system Python install could become a wasteland of
dozens of packages, all installed by hand, and you could even find that the new packages you tried to
install would break because they were incompatible with one of the old packages sitting on your hard
drive from a project that ended months ago.
 
------分隔线----------------------------

锋哥公众号


锋哥微信


关注公众号
【Java资料站】
回复 666
获取 
66套java
从菜鸡到大神
项目实战课程

锋哥推荐