本文整理汇总了Python中executor.Executor.debug方法的典型用法代码示例。如果您正苦于以下问题:Python Executor.debug方法的具体用法?Python Executor.debug怎么用?Python Executor.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类executor.Executor
的用法示例。
在下文中一共展示了Executor.debug方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from executor import Executor [as 别名]
# 或者: from executor.Executor import debug [as 别名]
def main():
parser = argparse.ArgumentParser(description='Produce RNA from DNA')
parser.add_argument('--trace', action='store_true')
parser.add_argument('--pause', action='store_true')
parser.add_argument('prefix_filename')
args = parser.parse_args()
prefix_filename = args.prefix_filename
prefix = open(prefix_filename+'.dna').read().strip()
assert all(c in 'ICFP' for c in prefix)
e = Executor(prefix+endo())
e.debug = args.trace or args.pause
start = clock()
#for r in e.obtain_rna():
# print>>rna, r
try:
while True:
e.step()
if args.pause:
print 'press enter',
raw_input()
except FinishException:
pass
rna_file = open(prefix_filename+'.rna', 'w')
for r in e.rna:
print>>rna_file, r
print 'it took', clock()-start
print int(e.iteration/(clock()-start+1e-6)), 'iterations/s'
rna_file.close()
示例2: generate_trace
# 需要导入模块: from executor import Executor [as 别名]
# 或者: from executor.Executor import debug [as 别名]
def generate_trace(n_steps=10):
e = Executor(endo())
e.debug = True
for i in range(n_steps):
e.step()