writing a list of tuples to a text file in python,f.write(' '.join(str(s) for s in t) + '\n')