starting_pitcher.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:sportsball 作者: jgershen 项目源码 文件源码
def parse_game_row(game_row):
  'NYM - N. Syndergaard (4-5, 3.05)'
  home_cell = game_row.find('td', {'class': 'shsNamD shsProbHome'})
  away_cell = game_row.find('td', {'class': 'shsNamD shsProbAway'})
  home_match = pitcher_re.search(home_cell.text)
  away_match = pitcher_re.search(away_cell.text)
  if not home_match or not away_match:
    print 'Problem with RE matching!'
    import IPython
    IPython.embed()
  home_groups = home_match.groupdict()
  away_groups = away_match.groupdict()
  home_team = fix_team(home_groups['team'])
  away_team = fix_team(away_groups['team'])
  # Return teams, projected starters, @ if away, and opponents
  team_rows = [[home_team, home_groups['starter'], None, away_team],
               [away_team, away_groups['starter'], '@', home_team]]
  return team_rows
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号