Minimal working example of my code:
# Create output data file out_data_file = open(\'output_file\',\'w\') out_data_file.write(\"# Header \\n\") out_data_file.clo
Use In [10]: list1 = [1,3,4,5,12,6,2,35,74,6,2] In [11]: " ".join(map(str, list1)) Out[11]: '1 3 4 5 12 6 2 35 74 6 2'
...or in your case:
f.write('Text' + ' ' + " ".join(map(str, list1)))