我有一个循环,使用PySide根据用户输入的号码创建窗口 每个窗口都会有一些其他功能的调用。
我想在第一个窗口的所有命令完成后打开第二个窗口。
那么,有没有在Python的方式来告诉循环停止,直到一定的标志是TRUE例如在Python中暂停循环
下面是我在做什么
for i in range(values):
self.CreatWindow() # the function that creates the window
def CreatWindow(self):
window = QtGui.QMainWindow(self)
window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
combo = QtGui.QComboBox(window)
combo.addItem(" ")
combo.addItem("60")
combo.addItem("45")
combo.activated[str].connect(self.onActivated)
btn = QtGui.QPushButton('OK', window)
btn.clicked.connect(self.ComputeVec)
window.show()
def onActivated(self, text):
angle = int(text)
def ComputeVec(self):
window.close()
getVecValue(angle)
现在该功能的窗口有几个电话到其他函数,我想在最后一个函数getVecValue
中将标志设置为True,它将执行一些计算并存储结果。
工作感谢 – Lily 2013-03-24 12:27:12