Re: [Tutor] What does "TypeError: 'int' object is not iterable" mean?

2010-10-21 Thread Richard D. Moores
On Thu, Oct 21, 2010 at 14:21, Sander Sweers wrote: > On 21 October 2010 18:09, Richard D. Moores wrote: >> I'd appreciate constructive criticism. > > Instead of all the zeros2float craziness use string formatting. It > will take care of rounding and the number of decimal places. > import d

Re: [Tutor] What does "TypeError: 'int' object is not iterable" mean?

2010-10-21 Thread Sander Sweers
On 21 October 2010 18:09, Richard D. Moores wrote: > In case anyone's interested, the script now works the way I wanted: > . It should work for anyone > with 2.6 or 2.7 > > I'd appreciate constructive criticism. Instead of all the zeros2float craziness use s

Re: [Tutor] csv DictReader/Writer question

2010-10-21 Thread Ara Kooser
Peter, Thank you for your response. I did try reading the documentation but I missed something (or several somethings in this case). So what I see in the code you supplied is: with open(source, "rb") as instream: reader = csv.DictReader(instream, skipinitialspace=True) destfieldnames = l

Re: [Tutor] What does "TypeError: 'int' object is not iterable" mean?

2010-10-21 Thread Richard D. Moores
Wow! What great help! Thanks! In case anyone's interested, the script now works the way I wanted: . It should work for anyone with 2.6 or 2.7 I'd appreciate constructive criticism. Dick ___ Tutor maillist - Tuto

Re: [Tutor] What does "TypeError: 'int' object is not iterable" mean?

2010-10-21 Thread Alan Gauld
"Richard D. Moores" wrote unchanged_count, higher_count, lower_count, secs = sleep_seconds_control(unchanged_count, higher_count, lower_count, secs) TypeError: 'int' object is not iterable I'm at a loss as to what the error means. a.. def sleep_seconds_control(unchanged_count, higher_cou

Re: [Tutor] Stopping a webservice

2010-10-21 Thread ALAN GAULD
Forwarding to list "Timo" wrote >> >> >>The plans are to run this on my webserver. I created a webpage with a start >>>and stop button, the starting works great. But how could I remember this >>>class to call "class.shutdown = True" any given time when I press the stop >>>button? >>> > There

Re: [Tutor] What does "TypeError: 'int' object is not iterable" mean?

2010-10-21 Thread Christian Witts
On 21/10/2010 14:42, Richard D. Moores wrote: Traceback (most recent call last): File "c:\P26Working\test_urllib2_21a.py", line 148, in unchanged_count, higher_count, lower_count, secs = sleep_seconds_control(unchanged_count, higher_count, lower_count, secs) TypeError: 'int' object is not

Re: [Tutor] What does "TypeError: 'int' object is not iterable" mean?

2010-10-21 Thread Eloy Zuniga Jr.
Forget what I said. Tim's right. Return an iterable from within your method not an integer. On Thu, Oct 21, 2010 at 7:52 AM, Tim Golden wrote: > On 21/10/2010 13:42, Richard D. Moores wrote: > >> Traceback (most recent call last): >> File "c:\P26Working\test_urllib2_21a.py", line 148, in >>

Re: [Tutor] What does "TypeError: 'int' object is not iterable" mean?

2010-10-21 Thread Eloy Zuniga Jr.
One of your variables (e.g. unchanged_count, higher_count, lower_count, secs) is an integer and your method expects a sequence (iterable) value. Examples of iterable values: 1. str 2. unicode 3. list 4. tuple 5. xrange and range On Thu, Oct 21, 2010 at 7:42 AM, Richard D. Moores

Re: [Tutor] What does "TypeError: 'int' object is not iterable" mean?

2010-10-21 Thread Emmanuel Ruellan
On Thu, Oct 21, 2010 at 2:42 PM, Richard D. Moores wrote: Traceback (most recent call last): File "c:\P26Working\test_urllib2_ > > 21a.py", line 148, in >unchanged_count, higher_count, lower_count, secs = > sleep_seconds_control(unchanged_count, higher_count, lower_count, > secs) > TypeErro

Re: [Tutor] What does "TypeError: 'int' object is not iterable" mean?

2010-10-21 Thread Tim Golden
On 21/10/2010 13:42, Richard D. Moores wrote: Traceback (most recent call last): File "c:\P26Working\test_urllib2_21a.py", line 148, in unchanged_count, higher_count, lower_count, secs = sleep_seconds_control(unchanged_count, higher_count, lower_count, secs) TypeError: 'int' object is not

[Tutor] What does "TypeError: 'int' object is not iterable" mean?

2010-10-21 Thread Richard D. Moores
Traceback (most recent call last): File "c:\P26Working\test_urllib2_21a.py", line 148, in unchanged_count, higher_count, lower_count, secs = sleep_seconds_control(unchanged_count, higher_count, lower_count, secs) TypeError: 'int' object is not iterable I'm working on a script that keeps tra

Re: [Tutor] csv DictReader/Writer question

2010-10-21 Thread Peter Otten
Ara Kooser wrote: > Hello all, > > I have a csv file (from a previous code output). It looks like this: > Species2, Protein ID, E_value, Length, Hit From, Hit to, Protein ID2, > Locus Tag, Start/Stop, Species > Streptomyces sp. AA4, ZP_05482482, 2.82936001e-140, 5256, > 1824, > 2249

Re: [Tutor] LCM

2010-10-21 Thread Alan Gauld
"Jacob Bender" wrote decided to make a program that deals with them. Here's the code: thing = raw_input("What is the first number?\n\n") thing2 = raw_input("What is the second number?\n\n") int(thing) int(thing2) This does nothing useful. It converts the strings to numbers which are immedi

Re: [Tutor] Importing photo-python

2010-10-21 Thread Alan Gauld
"steven nickerson" wrote i I would like to somehow import and output a photo to the screen via tkinter window Check out the PhotoImage widget. It can be inserted into a Text field or Canvas. HTH, Alan G. ___ Tutor maillist - Tutor@python.or