title: How can I break when found QR Code in Python?
body: <p>I'm trying to learning QR Code module in Python and I'm trying to make some codes so I want to break when I found QR Code how can I do that?</p>
  <p><strong>My code is:</strong></p>
  <pre><code>while 1:
  
      success, img= cap.read()
      for x in decode(img):
          data1 = x.data.decode('utf-8')
          pts = np.array([x.polygon],np.int32)
          pts = pts.reshape((-1,1,2))
          cv2.polylines(img,[pts],True,(122,25,245),(3))
          print(data1)
          
      cv2.imshow('Result',img)
      cv2.waitKey(10)
  </code></pre>