
- Python —— 网络编程
- Python —— 网络简介
- Python —— 网络环境
- Python —— 互联网协议
- Python —— IP 地址
- Python —— DNS 查找
- Python —— 路由
- Python —— HTTP 请求
- Python —— HTTP 响应
- Python —— HTTP 标头
- Python —— 自定义 HTTP 请求
- Python —— 请求状态码
- Python —— HTTP 身份验证
- Python —— HTTP 数据下载
- Python —— 连接重用
- Python —— 网络接口
- Python —— 套接字编程
- Python —— HTTP 客户端
- Python —— HTTP 服务器
- Python —— 构建 URL
- Python —— Web 表单提交
- Python —— 数据库和 SQL
- Python —— Telnet
- Python —— 电子邮件
- Python —— SMTP
- Python —— POP3
- Python —— IMAP
- Python —— SSH
- Python —— FTP
- Python —— SFTP
- Python —— Web 服务器
- Python —— 上传数据
- Python —— 代理服务器
- Python —— 目录列表
- Python —— 远程过程调用
- Python —— RPC JSON 服务器
- Python —— Google 地图
- Python —— RSS Feed
Python —— Google 地图
Python 提供了可直接将 Google 地图中的地址转换为地理坐标的模块。这有助于查找企业地址和定位不同地址的接近程度。
我们使用一个名为 pygeocoder 的模块来接收地址和地理编码。此模块通过以下命令通过 pip 进行安装。
安装 pygeocoder
pip install pygeocoder
查找企业地址
我们提交一个企业名称作为输入,程序会给出完整的地址作为输出。该模块使用 Google 地图中的数据在后台检索结果。
from pygeocoder import Geocoder business_name = "Workafella Business Centre - Hitec city" print "Searching %s" %business_name results = Geocoder.geocode(business_name) for result in results: print result
当我们运行上述程序时,会得到以下输出 −
Searching Workafella Business Centre - Hitec city Western pearl building 1st floor, Hitech City Rd, Opposite HDFC Bank, Kondapur, Hyderabad, Telangana 500084, India
广告