title: Python Image Window Not Closing Properly on Mac
body: <p>I'm working with OpenCV and trying to figure this out. When I want to read and show an image:</p>
  <pre><code>import cv2
  
  img = cv2.imread('baboon.jpg', 0)
  cv2.imshow('image', img)
  cv2.waitKey(0)
  cv2.destroyWindow('image')
  </code></pre>
  <p>I write this. But whenever the image display window pops up, I'm not able to close it and execute everything after</p>
  <pre><code>cv2.imshow('image', img)
  cv2.waitKey(0)
  cv2.destroyWindow('image')
  </code></pre>
  <p>because the window will not close unless I quit it.</p>
  <p>For example, if I run this code</p>
  <pre><code>import cv2
  
  img = cv2.imread('baboon.jpg', 0)
  cv2.imshow('image', img)
  cv2.waitKey(0)
  cv2.destroyWindow('image')
  #Nothing after this will get executed
  print('Hello')
  </code></pre>
  <p>I get no output in my console, but the image window does pop up.</p>
  <p>How can I fix this?</p>
  <p>(I'm using Pycharm if that helps)</p>
  <p>EDIT:</p>
  <p>It seems that whenever I press <strong>any</strong> key the window closes and it works as intended (code after the comment is executed). Not sure why this is happening.</p>