我正在尝试编写一个代码,以便它重复图像J中的一系列命令,直到用户对结果满意为止。这就是我所尝试的:
from ij.gui import NonBlockingGenericDialog
num = True
while num is True:
#a series of a commands will go here
dia2 = NonBlockingGenericDialog("Better")
dia2.addMessage("does that look good?")
dia2.showDialog()
if dia2.wasCanceled:
rm.reset()
num = True
print num
elif dia2.wasOKed:
print "background good"
num = False
break
问题是,即使对话框被OKed,脚本也会留在循环中,从而创建一个无限循环。我不知道如何格式化这个适当打破循环时,必要的。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐