Jul-13-2017, 06:59 PM
Don't make a string out of it first. You make a string out of it, and then zip a list of just the string. Zipping a list of one item does nothing. Zip takes multiple lists and transposes them, so you need to give it multiple lists with multiple items each. Then you print the results rather than writing them to the file. Since datadict is a lists of the lists you want to zip, you need to unpack it with the star operator (*). So remove
datadict = str(datadict)
, and change your for loop to:for row in zip(*datadict): writer.writerow(row) print('Done')Note that you don't need an explicit quit() at the end of a program. Finally, since datadict is a list, please don't call it a dict. It makes your code confusing.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures