title: How to save files in correct numbered directory using OpenCV
body: <p>If I have folders with a number followed by an arbitrary title</p>
  
  <pre><code>1 - Dog
  2 - Cat
  3 - Frog
  ...
  999 - Penguin
  </code></pre>
  
  <p>And in my code I have something like this (very stripped down)</p>
  
  <pre class="lang-py prettyprint-override"><code>num = 1
  for x in range(100):
     cv2.imwrite("C:/path/to/1 - Dog/%d.PNG" % x, image)
  
     if x % 5 == 0:
        num += 1:
  </code></pre>
  
  <p>Is there a way to put in the <code>num</code> variable in the input to <code>cv2.imwrite()</code> (currently "C:/path/to/1 - Dog/%d.PNG" % x) to allow my script to automatically switch folders to whatever the value of <code>num</code> is (every time a condition is met)?</p>
  
  <p>The folder being saved to should always follow the value of <code>num</code>, where the value matches the number in the name of the folder.</p>