本文整理汇总了Python中Timer.Timer.setItter方法的典型用法代码示例。如果您正苦于以下问题:Python Timer.setItter方法的具体用法?Python Timer.setItter怎么用?Python Timer.setItter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer.Timer
的用法示例。
在下文中一共展示了Timer.setItter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from Timer import Timer [as 别名]
# 或者: from Timer.Timer import setItter [as 别名]
def main(players, **settings):
def On(key):
return key in settings and settings[key] != 0
if On('timers'):
timer2 = Timer()
#printAIData(aidata)
statdata = [0, 0, 0, []]
games = []
if On('times'):
print "Running", (settings['times']), "games"
if On('progressbar'):
bar = ProgressProcess(settings['times'], settings['progressbar'])
#bar.setNewline()
if On('timers'):
timer = Timer(settings['times'])
try:
if On('times'):
for a in range(0, settings['times']):
play(players, statdata, games, On)
if On('progressbar'):
bar.update(a)
if On('progressbar'):
bar.success()
#del bar
else:
while (1):
play(players, statdata, games, On, **settings)
except UserError:
print "\nUser quit."
except KeyboardInterrupt:
print
if On('timers'):
timer.setItter(a)
except:
if On('timers'):
timer.setItter(a)
handleError()
finally:
if On('times'):
print "Ran", a + 1, " times."
if On('timers'):
del timer
if On('lastfifteen'):
printGames(games)
if On('stats'):
printStats(statdata)