title: get iterator value from itertool created variable python
body: <p>I created an iterator to increment the figure number in various plotting function calls:</p>
  <pre><code>figndx=itertools.count()
  </code></pre>
  <p>I then proceed to call these throughout my code, passing <code>next(figndx)</code> as an argument to increment the value I use for the figure number: - for ex:</p>
  <pre><code>an.plotimg(ref_frame,next(figndx),'Ref Frame')
  an.plotimg(new_frame,next(figndx),'New Frame')
  </code></pre>
  <p>etc...</p>
  <p>After some particular function call, I want to read back the <code>figndx</code> value and store it in a variable for later use.  However, when I look at <code>figndx</code> , it returns <code>count(7)</code>, for example.  How do I extract the '7' from this?</p>
  <p>I've tried :</p>
  <p><code>figndx</code></p>
  <p><code>figndx.__iter__()</code></p>
  <p>and I can't find anything else in the 'suggested' methods (when I type the dot (.)) that will get the actual iterator value.  Can this be done?</p>
  <p>`</p>