SyntaxFix
Write A Post
Hire A Developer
Questions
You've got all the necessary pieces somewhere in this thread:
if cv2.waitKey(): cv2.destroyAllWindows()
works fine for me in IDLE.