with open('daemons.txt', 'w') as fp:
fp.write('\n'.join('%s %s' % x for x in mylist))
If you want to use str.format(), replace 2nd line with:
fp.write('\n'.join('{} {}'.format(x[0],x[1]) for x in mylist))
with open('daemons.txt', 'w') as fp:
fp.write('\n'.join('%s %s' % x for x in mylist))
If you want to use str.format(), replace 2nd line with:
fp.write('\n'.join('{} {}'.format(x[0],x[1]) for x in mylist))