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
f.write('Text'+' '+' '.join('%d' % item for item in list1))
Or, since it looks like you are OK with the default conversion of an integer to string:
f.write('Text'+' '+' '.join(str(item) for item in list1))
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)))