str = ('123456')
fh = open('666.txt', 'w', encoding='utf-8')
fh.write(str)
fh.close()

相关文章: