使用geopy计算经纬度表示的坐标之间的距离
1.通过地图获取需要地点的经纬度
https://map.bmcx.com/
2.使用geopy计算距离
from geopy.distance import distance tianjin_coord=(39.06160486473199,117.14604690190004) others={ 'gongda':(39.06694512389212,117.11137719300893), 'tjz':(39.13833650542176,117.21108287572864) } for other,coord in others.items(): d=distance(tianjin_coord,coord).km #km是单位 print(other,d)