def load(filename):
'''
Load a saved monkeytree from disk
'''
if filename.endswith('.gz'):
fp = gzip.GzipFile(filename, 'r')
elif filename.endswith('.bz2'):
fp = bz2.BZ2File(filename, 'r')
else:
fp = open(filename, 'rb')
u = Unpickler(fp)
return MonkeyTree(root=u.load())
评论列表
文章目录