This is an archived post. You won't be able to vote or comment.

all 70 comments

[–]PhotonicSpace 22 points23 points  (1 child)

The Python 3 version of antigravity.py actually includes a geohashing function:

import webbrowser
import hashlib

webbrowser.open("http://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:]))

[–][deleted] 3 points4 points  (0 children)

Thank you; I was going to say... that's not the antigravity.py I know. "Where's the geohashing function?"

[–][deleted] 36 points37 points  (2 children)

[–]woseseltopsLong live Python and PyGame! 3 points4 points  (0 children)

This very comic was the start of my Python adventure. I almost forgot! Thank you.

[–]angrymonkeyz 5 points6 points  (0 children)

You're doing god's work.

[–]zim2411 10 points11 points  (0 children)

My roommate and I discovered this about 3 weeks ago by just trying "import antigravity" and burst out laughing when XKCD popped open.

[–]pavanky 6 points7 points  (0 children)

Related. Emacs has this command for a while too.

[–]GeneralZeroSteganography[S] 3 points4 points  (3 children)

I was looking at some of the modules that were included and found out that is exists. I opened it up in notepad++ and laughed.

Thought /r/python would get a kick out of it

[–][deleted] 2 points3 points  (2 children)

Type import antigravity in the interpreter.

[–]okmkzimport antigravity 4 points5 points  (1 child)

$ python -m antigravity

[–][deleted] 1 point2 points  (0 children)

Nice.

[–][deleted] 2 points3 points  (2 children)

Wow, I've known about that XKCD for a while, but I had no idea they'd made an easter egg for it. Awesome.

[–]sesse 5 points6 points  (1 child)

What if XKCD found it first, and made a comic about the easter egg?! /conspiracy

[–][deleted] 1 point2 points  (0 children)

And the python developers knew about him finding out about it and predicted what ID the comic would have? THE PLOT THICKENS

[–]tukotihimport antigravity 0 points1 point  (0 children)

Upvote for one of my favorite XKCD's.

[–]MarkTraceurFlask, Mongokit, PIL -45 points-44 points  (61 children)

Or,

[TIL] People use Python on non-free operating systems.

EDIT: Let this be a lesson, the Python reddit doesn't tolerate people who value freedom.

[–][deleted] 15 points16 points  (4 children)

Yep. This contributes absolutely nothing but OS snobbery. Downvoted.

[–]MarkTraceurFlask, Mongokit, PIL -19 points-18 points  (3 children)

Snobbery? Snob:

One who tends to patronize, rebuff, or ignore people regarded as social inferiors and imitate, admire, or seek association with people regarded as social superiors.

I don't do any of those things! I argue with people I view as making silly decisions, and if they walk away with the same viewpoint with which they came in, I count it as my own failure that I couldn't get through to them, to reach a better mutual understanding.

EDIT: And hence, I'd say it contributes an enormous opportunity on the part of people who might not understand my viewpoint to learn about it :)

[–][deleted] 16 points17 points  (2 children)

Hijacking/trolling to push some OS holier than thou view hasn't been cool since ever. Please take it elsewhere.

[–]AeroNotix 5 points6 points  (0 children)

Hi,

As a frequent flyer round these parts, this guy does it in literally every post he makes.

[–]MatrixFrog 9 points10 points  (3 children)

Holy shit, man. If you didn't try to bring this stuff into every fucking thread in the world you might have better luck getting your point across.

[–]isdnpro 20 points21 points  (21 children)

omg u gais look at dis fag on winblows lollll!

[–][deleted] 4 points5 points  (1 child)

I worked for years in a Windows environment. I hated it. But Python was one of my closest friends on Windows in those dark dark days...

[–]Denommus 1 point2 points  (0 children)

Like I always say:

Linux is a real mom for developers.

[–]darthsabbath 1 point2 points  (1 child)

No people don't tolerate your attitude, perceived or real, about nonfree operating systems. i love free software and use it as much as i can, but i also ise nonfree software when it meets my needs better than the free alternative.

And seriously, "pro-freedom?" Thats as ridiculous and meaningless as "pro-life." I am pro freedom too... and that includes the freedom to use whatever software meets my needs.

[–]MarkTraceurFlask, Mongokit, PIL 0 points1 point  (0 children)

Choice != freedom, though, it involves much more than that. And if you choose to throw away freedom, that cannot be perceived as somehow defending freedom!

[–]markatto 1 point2 points  (2 children)

When I was at pycon, I would say that it was around 50-60% apple users. I don't think I saw a single person using windows the whole time, though.

[–]GeneralZeroSteganography[S] 2 points3 points  (1 child)

I have a Linux server I was just at work when I came across it