本文整理汇总了Python中experiment.Experiment.bar方法的典型用法代码示例。如果您正苦于以下问题:Python Experiment.bar方法的具体用法?Python Experiment.bar怎么用?Python Experiment.bar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类experiment.Experiment
的用法示例。
在下文中一共展示了Experiment.bar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print_periodic
# 需要导入模块: from experiment import Experiment [as 别名]
# 或者: from experiment.Experiment import bar [as 别名]
def print_periodic():
print "PERIODIC!"
exp = Experiment()
#with UntilDone():
# Wait(5.0)
with Meanwhile():
with Loop():
Wait(5.0)
Func(print_periodic)
Debug(width=exp.screen.width, height=exp.screen.height)
exp.bar = False
with Parallel():
with Serial():
Wait(2.0)
Func(lambda: None) # force variable assignment to wait until correct time
exp.bar = True
Wait(2.0)
Func(lambda: None) # force variable assignment to wait until correct time
exp.bar = False
Wait(1.0)
When(exp.bar, Debug(name="when test"))
with While(exp.bar):
with Loop():
Wait(0.2)
Debug(name="while test")
with Loop(blocking=False):