f = open('test.txt', 'w') f.write('This is a test') f.write('Yes this is a test') f.close()