本文整理汇总了Python中track.Track.load方法的典型用法代码示例。如果您正苦于以下问题:Python Track.load方法的具体用法?Python Track.load怎么用?Python Track.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类track.Track
的用法示例。
在下文中一共展示了Track.load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import load [as 别名]
def load(self, tracknames=None):
treestr = self.level*TAB + self.id + '/'
# print string to tree hierarchy and screen
self.writetree(treestr + '\n')
print(treestr)
if tracknames != None:
tracknames = tolist(tracknames)
dirnames = tracknames
else:
# all track folder names for this animal:
dirnames = [ dirname for dirname in os.listdir(self.path)
if os.path.isdir(os.path.join(self.path, dirname))
and dirname.lower().startswith('tr') ]
dirnames.sort() # alphabetical order
for dirname in dirnames:
path = os.path.join(self.path, dirname)
track = Track(path, animal=self)
track.load()
self.tr[track.id] = track
self.__setattr__('tr' + str(track.id), track) # add shortcut attrib