简体   繁体   中英

Call Google Map Javascript API from python

i would like to call this method from Google Maps Javascript API: google.maps.geometry.spherical.computeDistanceBetween(origin, destination) from python, not from javascript. How can I do it ?

Thanks.

You could use a library called requests .

Sample request:

>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=utf8'
>>> r.encoding
'utf-8'
>>> r.text
u'{"type":"User"...'
>>> r.json()
{u'private_gists': 419, u'total_private_repos': 77, ...}

A short tutorial you could use

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM