Staging
v0.5.1
https://github.com/python/cpython
Revision fd340bf9e308130736c76257ff9a697edbeb082d authored by Miss Islington (bot) on 05 March 2018, 16:49:15 UTC, committed by GitHub on 05 March 2018, 16:49:15 UTC

Like Python, IDLE optionally runs one startup file in the Shell window
before presenting the first interactive input prompt.  For IDLE,
option -s runs a file named in environmental variable IDLESTARTUP or
PYTHONSTARTUP; -r file runs file.  Python sets __file__ to the startup
file name before running the file and unsets it before the first
prompt.  IDLE now does the same when run normally, without the -n
option.
(cherry picked from commit 22c82be5df70c3d51e3f89b54fe1d4fb84728c1e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
1 parent f92478d
Raw File
Tip revision: fd340bf9e308130736c76257ff9a697edbeb082d authored by Miss Islington (bot) on 05 March 2018, 16:49:15 UTC
bpo-32984: IDLE - set __file__ for startup files (GH-5981)
Tip revision: fd340bf
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

    '''
    # http://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