Staging
v0.8.1
https://github.com/python/cpython
Revision 708f472dd92f4f46c27ace710492da65da4a3319 authored by Miss Islington (bot) on 06 February 2020, 08:45:18 UTC, committed by GitHub on 06 February 2020, 08:45:18 UTC
(cherry picked from commit 54b4f14712b9350f11c983f1c8ac47a3716958a7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 927d3aa
Raw File
Tip revision: 708f472dd92f4f46c27ace710492da65da4a3319 authored by Miss Islington (bot) on 06 February 2020, 08:45:18 UTC
bpo-38149: Call sys.audit() only once per call for glob.glob(). (GH-18360)
Tip revision: 708f472
antigravity.py

import webbrowser
import hashlib

webbrowser.open("https://xkcd.com/353/")

def geohash(latitude, longitude, datedow):
    '''Compute geohash() using the Munroe algorithm.

    >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
    37.857713 -122.544543

    '''
    # https://xkcd.com/426/
    h = hashlib.md5(datedow).hexdigest()
    p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])]
    print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:]))
back to top