Forget what I said.  Tim&#39;s right.<div><div>Return an iterable from within your method not an integer.</div><div><br><br><div class="gmail_quote">On Thu, Oct 21, 2010 at 7:52 AM, Tim Golden <span dir="ltr">&lt;<a href="mailto:mail@timgolden.me.uk">mail@timgolden.me.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 21/10/2010 13:42, Richard D. Moores wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Traceback (most recent call last):<br>
   File &quot;c:\P26Working\test_urllib2_21a.py&quot;, line 148, in&lt;module&gt;<br>
     unchanged_count, higher_count, lower_count, secs =<br>
sleep_seconds_control(unchanged_count, higher_count, lower_count,<br>
secs)<br>
TypeError: &#39;int&#39; object is not iterable<br>
<br>
I&#39;m working on a script that keeps track of the USD -&gt;  Japanese Yen<br>
exchange rate. I&#39;m experimenting with adding functionality that<br>
changes the seconds to sleep between web scrapes, depending on<br>
consecutive outputs of no change in the exchange rate. Please see the<br>
code at&lt;<a href="http://tutoree7.pastebin.com/KWmdk8jb" target="_blank">http://tutoree7.pastebin.com/KWmdk8jb</a>&gt;<br>
</blockquote>
<br></div>
sleep_seconds_control is returning an integer.<br>
<br>
You&#39;re trying to assign that integer to the four names:<div class="im"><br>
unchanged_count, higher_count, lower_count, secs<br>
<br></div>
Python therefore tries to iterate over the integer to<br>
allocate one item to each of the four name.<br>
<br>
And it can&#39;t. Because it&#39;s an integer<br>
<br>
TJG<div><div></div><div class="h5"><br>
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Eloy Zuniga Jr.<br><a href="http://www.eloyz.com">www.eloyz.com</a><br>
</div></div>