我有一個場景,我在一組操作後調用特定的代碼塊。我在Python中使用了go-to
和label
。它按預期工作。如何解決python中的go-to?
有沒有其他更好的選擇呢?
這是使用Squish-for-QT進行自動化的Python代碼。
label .mylabel
while (cond1):
print("inside cond1")
Function1(x,y,z)
else:
if (object.exists("obj1")):
Screen1 = waitForObject("obj1")
print ("Inside Screen1")
while (Screen1.visible):
Function1(a,b,c)
else:
goto .mylabel
可能的重複[是否有Python中的標籤/轉到?](https://stackoverflow.com/questions/438844/is-there-a-label-goto-in-python) – Makoto
_「它的工作原理預計。「_ - 它呢? Python不支持goto的本地支持。你在用圖書館嗎? –
是的,它的工作。我使用了「entrian go-to」庫。現在,我編輯了代碼以使用「wphicks」建議的「while True」解決方案 –