examples/files/write.py
#!/usr/bin/env python

filename = 'data.txt'

out = open(filename, 'w')
out.write('text\n')
out.close()