I am not getting the same results as you are because there are more problems in this code that happen before I can even see that error. You have a mixture of global references that don't seem to work properly.
Can you include a complete traceback to identify the line that is failing? wordCounter is a defaultdict, which is an iterable, so I am not sure which part is causing that error you mention. On Fri, Nov 2, 2012 at 9:22 AM, damon shelton <[email protected]>wrote: > word counter is a python function object, and probably does not allow +=1 > on it or calling wordCounter[word] > maybe just make a standard int variable called count and +=1 on it > everytime you find a word > > if you just send > for line in source: > for word in line.split(): > count += 1 > > > On Thu, Nov 1, 2012 at 9:15 PM, KI DONG PARK <[email protected]> wrote: > >> I got error when I try executing it that is 'function' object is not >> iterable. >> And I have no idea how I should improve it now. >> Anybody give me some helping? >> Thanks. >> >> -- >> view archives: http://groups.google.com/group/python_inside_maya >> change your subscription settings: >> http://groups.google.com/group/python_inside_maya/subscribe >> > > -- > view archives: http://groups.google.com/group/python_inside_maya > change your subscription settings: > http://groups.google.com/group/python_inside_maya/subscribe > -- view archives: http://groups.google.com/group/python_inside_maya change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
