本文整理汇总了Python中Table.Table.is_closed方法的典型用法代码示例。如果您正苦于以下问题:Python Table.is_closed方法的具体用法?Python Table.is_closed怎么用?Python Table.is_closed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table.Table
的用法示例。
在下文中一共展示了Table.is_closed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: str
# 需要导入模块: from Table import Table [as 别名]
# 或者: from Table.Table import is_closed [as 别名]
print player.name + " put " + str(played_card) + " on the table"
else:
print player.name + " close a card"
n_turns += 1
print "the game is finished"
table.show()
print "scoreboard : "
t = PrettyTable()
game_points = []
closed_cards = []
for p in players:
game_points.append(p.get_points(table.is_closed(), table.closed_at))
closed_cards.append(p.closed)
n_rows = [ len(closed) for closed in closed_cards ]
max_n_rows = max(n_rows)
for closed in closed_cards:
for i in range(max_n_rows - len(closed)):
closed.append("")
for p_idx, closed in enumerate(closed_cards):
t.add_column(players[p_idx].name, closed)
print t
print "the loser is " + players[game_points.index(max(game_points))].name