Getting map location Python -


is there way computer geolocation (as in google maps "my location") python script? computer connected internet.

>>> import re,requests >>> raw = requests.get('http://www.geoiptool.com/').text >>> latlon = re.search("gpoint\(([^)]+)\)",raw).groups(0) >>> lat,lon = map(float,latlon[0].split(",")) >>> print "latitude:%s   longitude:%s"%(lat,lon) latitude:-117.2455   longitude:46.7322 

a couple of caveats ...

  1. this not best method , should not done on , on again or might upset site owners

  2. this uses ip lookups may not gps/wifi coordinates


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -