
- 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
廣告