當前位置: 首頁>>代碼示例>>Python>>正文


Python Team.addGame方法代碼示例

本文整理匯總了Python中team.Team.addGame方法的典型用法代碼示例。如果您正苦於以下問題:Python Team.addGame方法的具體用法?Python Team.addGame怎麽用?Python Team.addGame使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在team.Team的用法示例。


在下文中一共展示了Team.addGame方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: len

# 需要導入模塊: from team import Team [as 別名]
# 或者: from team.Team import addGame [as 別名]
for line in f:
    gam = line.split("\t")
    if curseason is not gam[0]:
        if len(seas.keys()) > 0:
            seasons.append(deepcopy(seas))
        seas.clear()
        curseason = gam[0]
    if gam[2] in seas:
        team1 = seas[gam[2]]
    else:
        team1 = Team(names[gam[2]])
    if gam[4] in seas:
        team2 = seas[gam[4]]
    else:
        team2 = Team(names[gam[4]])
    team1.addGame(Game(gam[4], gam[3], gam[5]))
    team2.addGame(Game(gam[2], gam[5], gam[3]))
    seas[gam[2]] = deepcopy(team1)
    seas[gam[4]] = deepcopy(team2)
seasons.append(deepcopy(seas))
# seas.clear()

for i in range(2, len(seasons)):
    seaso = seasons[i]
    q = open(str(1996 + i) + "se.txt", "r")
    teamStats = dict()
    for lines in q:
        stat = lines.split("\t")
        teamStats[stat[1]] = lines
    for team in seaso.keys():
        if team not in teamStats:
開發者ID:paoloruiz,項目名稱:basketball,代碼行數:33,代碼來源:ranks.py


注:本文中的team.Team.addGame方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。