range() keeps returning empty list
<p>long time lurker first time poster. This is really stumping me. So I have a function:</p>

<pre><code>def button_pressed():
    first_day = int(daterangeT1.get("1.0","end-1c"))
    last_day = int(daterangeT1.get("1.0","end-1c"))
    days = range(first_day, last_day)
</code></pre>

<p>So i have tried many different ways but the range() call doesn't seem to like the two variables above it. They are both integers. It is always returning an empty list when i do a print command. Simply: "[]"</p>

<p>Any help greatly appreciated thanks :)</p>

<p>It seems like <code>first_day</code> and <code>last_day</code> are equal (you are getting the same key from the <code>daterangeT1</code> dictionary/object), and <code>range(x, x)</code> returns an empty list.</p>

<p>Also note that if <code>daterangeT1</code> is indeed a dictionary, if the <code>'1.0'</code> key doesn't exist then <code>get</code> will return the string <code>'end-1c'</code> which will cause a <code>ValueError</code> when trying to convert to <code>int</code>. </p>

python list range