返回顶部

收藏

Demonstrates writing to a text file

更多
# 

print 'Creating a text file with the write() method.'
text_file = open('write_it.txt', 'w')
text_file.write('Line 1\n')
text_file.write('This is line 2\n')
text_file.write('That makes this line 3\n')
text_file.close()

标签:Python,File

收藏

0人收藏

支持

0

反对

0

发表评论