title: with() statement to read from VideoCapture in opencv?
body: <p>I like using a with statement for accessing files and database connections because it automatically tears down the connection for me, in the event of error or file close.</p>
  
  <pre><code>f = open('file.txt', 'r')
  for i in f():
     print(i)
  f.close()
  </code></pre>
  
  <p>versus</p>
  
  <pre><code>with open('file.txt', 'r') as f:
     for i in f:
         print(i)
  </code></pre>
  
  <p>Is there an equivalent rephrasing for reading from the camera buffer in the following?:</p>
  
  <pre><code>c = cv.VideoCapture(0)    
  while(1):
      _,f = c.read()
      cv.imshow('e2',f)
      if cv.waitKey(5)==27:
          cv.waitKey()
          break
  c.release()
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>c = cv.VideoCapture(0)    
  while(1):
     with c.read() as _,f:
         cv.imshow('e2',f)
         if cv.waitKey(5)==27:
             cv.waitKey()
             break
  </code></pre>
  
  <p>---with no luck.  It looks like the tear-down/release is a different kind of function.  Is this idiom possible here?</p>