with open('output.txt', 'w') as f:
    f.write('Hello world!')