擅长:python、mysql、java
<p>如果在内环中找不到有效像素(因此没有出现<code>break</code>),则可以使用<code>for-else</code>构造来<code>continue</code>,如果找到有效像素,则可以使用<code>break</code>构造来外环:</p>
<pre><code>for row, pxl in enumerate(pxls):
for col, pxll in enumerate(pxl):
if pxll == (102, 102, 102) and col >= 71 and col <= 328 and row <= 530 and row >= 378:
foundpxl = pxll
print(str(col) + " , " + str(row))
pyautogui.click(col, row)
break
else:
continue
break
</code></pre>