import antigravity将打开一个指向经典XKCD漫画的网页(source:https://xkcd.com/353/),里面提到了Python。你知道吗,开发者并没有止步于此,彩蛋里还有一个彩蛋。 如果你查看代码(source:https://github.com/python/cpython/blob/master/Lib/antigravity.py#...
import antigravity将打开一个指向经典XKCD漫画的网页(source:https://xkcd.com/353/),里面提到了Python。你知道吗,开发者并没有止步于此,彩蛋里还有一个彩蛋。 如果你查看代码(source:https://github.com/python/cpython/blob/master/Lib/antigravity.py#L7-L17),你会看到一个函数定义用来实现XKCD’s的geohashin...
在Python里面import antigravity 会发现另一个小彩蛋 Tada~ 其实就是打开了xkcd的一个python主题漫画 鼠标停留在图片上,还会看到标题: “I wrote 20 short programs in Python yesterday. It was wonderful. Perl, I'm leaving you. 我昨天用Python写了20个小程序,感觉爽的飞起来了~ Perl 我不要你了。。。”...
这是个彩蛋。import antigravity将打开一个指向经典XKCD漫画的网页(source:https:///353/),里面提到了Python。你知道吗,开发者并没有止步于此,彩蛋里还有一个彩蛋。 如果你查看代码(source:https:///python/cpython/blob/master/Lib/antigravity.py#L7-L17),你会看到一个函数定义用来实现XKCD’s的geohashing算法...
>>>fromantigravityimportgeohash>>># Your location, a date and that date's (or most recent) DJIA opening.>>># 你的位置,一个日期和这个日期(或最近)对应的道琼斯工业指数。>>>geohash(37.421542,-122.085589,b'2005-05-26-10458.68')37.857713-122.544543 ...
import antigravity opens up a web browser pointing to the classic XKCD comic about Python. Well, there's more to it. There's another easter egg inside the easter egg. If you look at the code, there's a function defined that purports to implement the XKCD's geohashing algorithm.▶ go...
antigravity 模块是 Python 开发人员发布的少数复活节彩蛋之一. import antigravity 会打开一个 Python 的经典XKCD 漫画页面. 不止如此. 这个复活节彩蛋里还有一个复活节彩蛋. 如果你看一下代码, 就会发现还有一个函数实现了 XKCD's geohashing 算法.> goto, but why?/goto, 但为什么? *from goto import goto...
Source File: antigravity.py From jawfish with MIT License 5 votes 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....
In response to this comic, the Python developers implemented the module antigravity in version 2.7+. When you import it, the default web browser will open this comic. Also, in version 3+, the module contains a geohashing function.Add comment Create topic (use sparingly) Refresh ...
安装Xonsh 就像创建虚拟环境一样简单,运行 pip install xonsh [ptk,linux],然后运行 xonsh。 首先,你可能奇怪为什么你的 Python shell 有一个奇怪的提示: $ 1+1 2 好的,计算器! $ print("hello world") hello world 我们还可以调用其他函数: $ from antigravity import geohash ...