How to create an increasing counter of ranges?
<p>In a script I'm running, there is a memory leak issue (due to the proprietary software being used) that prevents a script for running for more than about 325k iterations. To get around this, I created a list of values for it to iterate through in a <code>for</code> loop like so:  </p>

<pre><code>squery = 
['OBJECTID &gt;=0 AND OBJECTID &lt;=300000',
'OBJECTID &gt;=300001 AND OBJECTID &lt;=600000',
'OBJECTID &gt;=600001 AND OBJECTID &lt;=900000',
....
'OBJECTID &gt;=8700001 AND OBJECTID &lt;=8766184']

for query in squery:
    do work
</code></pre>

<p>Is there a method to create these ranges in 300k intervals so that the list can be built at runtime with a intervals until the value reaches X? As in, 3 intervals for 900k records, and 5 intervals for 1.5 million records.</p>
