【问题标题】:ETE2 .phonehome() Is it an Easter Egg? [closed]ETE2 .phonehome() 是复活节彩蛋吗? [关闭]
【发布时间】:2014-04-25 14:22:31
【问题描述】:

ETE2(用于系统发育树探索的 Python 环境)有一个方法 .phonehome(),可以在树/节点类对象上调用。这将返回:

== Calling home... Got answer!

He11o alien,
How is everything in the Earth?
We miss you in Brodo Asogi.

I see you are in shape.
No updates are available.

== Do you want to leave any message?
(Press enter to finish)

如果您想自己测试一下,请尝试:

from ete2 import Tree
t = Tree()      # generate random Tree
t.phonehome()   # communicate with Aliens!

这是一个复活节彩蛋吗?

【问题讨论】:

  • 还有什么?我注意到该项目使用标志性的 ET 飞行循环剪影作为标志。
  • 一个真正的外星人试图交流
  • @hello_there_andy,嗨。

标签: python messaging etetoolkit


【解决方案1】:

project logo 是:

所以你可以称它为复活节彩蛋。但它也有一个真正的目的,因为它是项目版本检查方法,命名带有一点幽默:

''' I use this module to check for newer versions of ETE '''

def call():
    print "  == Calling home...",
    try:
        f = url.urlopen('http://ete.cgenomics.org/et_phone_home.php?VERSION=%s&ID=%s' 
                %(__VERSION__, __ETEID__))

和:

if not latest:
    print "I could not find data about your version [%s]" %module_name
    print "Are you ok?"
elif not current:
    print "I could not determine your version [%s]" %module_name
    print "Are you ok?"
    print "Latest stable ETE version is", latest
elif latest > current:
    print "You look a bit old."
    print "A newer version is available: rev%s" %latest
    print "Use 'easy_install -U %s' to upgrade" %module_name
else:
    print "I see you are in shape."
    print "No updates are available." 

source code of the ete2._ph modulephonehome() calls ete2._ph.call().

【讨论】:

  • 佩服你的侦探技巧!
  • @hello_there_andy:有什么改变让这个答案不再有用吗?
  • 我试图删除帖子:(这是邪恶的帖子!它必须死!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-05-14
  • 1970-01-01
  • 1970-01-01
  • 2012-02-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多