doble_bern

导航

 

在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 我不要你了。。。”  

好傲娇的感觉 

PYTHON

最后附上源码:

 1 import webbrowser
 2 import hashlib
 3 
 4 webbrowser.open("http://xkcd.com/353/")
 5 
 6 def geohash(latitude, longitude, datedow):
 7     '''Compute geohash() using the Munroe algorithm.
 8 
 9     >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
10     37.857713 -122.544543
11 
12     '''
13     # http://xkcd.com/426/
14     h = hashlib.md5(datedow).hexdigest()
15     p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])]
16     print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:]))

 

posted on 2016-10-19 22:23  doble_bern  阅读(1362)  评论(0编辑  收藏  举报