hel*_*ndy -2 python messaging etetoolkit
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)
Run Code Online (Sandbox Code Playgroud)
如果您想自己测试一下,请尝试:
from ete2 import Tree
t = Tree() # generate random Tree
t.phonehome() # communicate with Aliens!
Run Code Online (Sandbox Code Playgroud)
这是一个复活节彩蛋吗?
该项目的标志是:

所以你可以把它称为复活节彩蛋.但它也有一个真正的目的,因为它是项目版本检查方法,以一点点幽默命名:
''' I use this module to check for newer versions of ETE '''
Run Code Online (Sandbox Code Playgroud)
和
def call():
print " == Calling home...",
try:
f = url.urlopen('http://ete.cgenomics.org/et_phone_home.php?VERSION=%s&ID=%s'
%(__VERSION__, __ETEID__))
Run Code Online (Sandbox Code Playgroud)
和:
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."
Run Code Online (Sandbox Code Playgroud)
查看模块的源代码ete2._ph ; phonehome()电话ete2._ph.call().