python反重力模块的用途
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34472872/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Purpose of python antigravity module
提问by EyoelD
I was just digging up some cool modules in python, and this antigravity
module seems cool, and full of potentials, but I am not sure if it is what it sounds like.
我刚刚在 python 中挖掘了一些很酷的模块,这个antigravity
模块看起来很酷,而且充满潜力,但我不确定它是否听起来像。
Is there any use for it other than displaying the comic page on a browser? If there is, please do tell what it can be used for. Is there an example? Note that below in the link, that when the guy asks "But how are you flying?", the python dude answers, "I just typed import antigravity."
除了在浏览器上显示漫画页面之外,它还有什么用处吗?如果有,请告诉它可以用来做什么。有例子吗?请注意,在链接下方,当这个人问“但是你飞得怎么样?”时,蟒蛇家伙回答说,“我刚刚输入了 import antigravity。”
I was wondering if there actually is a way to make things fly by just importing antigravity, maybe in Pygame or other cross-platforms modules.
我想知道是否真的有一种方法可以通过导入反重力来让事情飞起来,也许在 Pygame 或其他跨平台模块中。
Here is the link...
链接在这里...
import antigravity
def main():
antigravity.fly()
if __name__=='__main__':
main()
采纳答案by nthall
No, it's just an easter egg. This brief blog posthas a bit more detail.
回答by Aryan Beezadhur
It's an easter egg, like import this
(The Zen of Python
on Wikipedia):
这是一个复活节彩蛋,例如import this
(The Zen of Python
在维基百科上):
>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
>>>