Python Forum

Full Version: TypeError: 'int' object is not iterable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
my question here

I was trying to execute the below code and it is throwing the error 'int object is not iterable'

Code:
def populatelivelist(self):
    print('POPULATING LIVE DATA INTO live_skillgroups_parent_list')
    for live_row in self.live_cursor:
        live_agent_id = str(live_row[0])
        live_skillgroup_refURL = str(live_row[1])
        live_skillgroup_name = str(live_row[2])
        #live_timestamp = str(live_row[2])
        self.live_skillgroups_parent_list.append(live_agent_id + ',' + live_skillgroup_refURL+','+live_skillgroup_name)
    print('live_skillgroups_parent_list: ', len(self.live_skillgroups_parent_list))
It looks like self.live_cursor is an integer not an iterable object - list, tuple, dictionary, set, or some generator.