"Mihai Iacob" <[EMAIL PROTECTED]> wrote in > > def saveBugs(data): > store = open(filename, 'w') > for timeMark,aList in data.items(): > store.write(timeMark + '\n') > store.write(aList + '\n') > store.close() > > After i run this part the following error pops up: > > Traceback (most recent call last): > store.write(aList + '\n') > TypeError: can only concatenate list (not "str") to > list
As the error says you can't join lists and strings, you need to convert the list to a string first. But it might be worth considering whether you will ever want to read that list back into your program, because if you do the simple str() functions representation of your list might not be the best. In that case you might want to write a functiuon to save the list item by item, and another to load the list back again. But if you just want to store the values to read in an editor the str() function will probably be just fine. HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor