本文整理汇总了Python中team.Team.set_opponent方法的典型用法代码示例。如果您正苦于以下问题:Python Team.set_opponent方法的具体用法?Python Team.set_opponent怎么用?Python Team.set_opponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类team.Team
的用法示例。
在下文中一共展示了Team.set_opponent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from team import Team [as 别名]
# 或者: from team.Team import set_opponent [as 别名]
if __name__ == "__main__":
#if len(sys.argv) < 2:
# print 'Enter game_id: YYYYMMDD0TID (note the 0 inbetween date and TeamID)'
# sys.exit(1)
#gameid = sys.argv[1]
gameid = "201603240BRK"
html_class = html_parser(gameid)
start = 0
pbp_lines = html_class.pbp_html.splitlines()
game_lines = html_class.game_html.splitlines()
home = Team()
away = Team()
home.set_opponent(away)
away.set_opponent(home)
game = Game()
# TODO: Better design?
for i in range(len(pbp_lines)):
line = pbp_lines[i]
if start:
if filter(line):
possession = line
side = which_team(possession)
if side == 1:
score, summary = clean_up(line)
home.stats_tracker(score + " " + summary)
elif side == 2: