1This error occurs when you try to use the integer type value as an array. In simple terms, this error occurs when your program has a variable that is treated as an array by your function, but actually, that variable is an integer.
1def write_file(data, filename): # creates file and writes list to it
2 with open(filename, 'wb') as outfile:
3 writer = csv.writer(outfile)
4 for row in data: # ABOVE ERROR IS THROWN HERE
5 writer.writerow(row)
6
1conn.execute("select name from artists order by name")
2row = conn.fetchall() #in mysql we must use fetchall() function inorder to split dataa beecause remember it is different from sqlite we use cursor here
3for artist in row:
4 artistlist.insert(tkinter.END, artist[0])