Demonstrates writing to a text file,,# print 'Cre
Demonstrates writing to a text file,,# print 'Cre
# 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()
相关内容
- Command Line Arguments,linearguments,#For instanc
- Import a package,importpackage,import rando
- Use time structure,usetimestructure,import timeg
- Sort elements in a list,sortelements,L = ['spam',
- Tuple assigment,tupleassigment,[a, b, c] =
- Convert tuple to a list and sort them,converttuple,T = ('cc', '
- Action Key: down arrow key,actionarrow,from Tkinter
- Multi-threading: zip file,multi-threadingzip,import threa
- Using form %(name)format, as shown here,usingshown,table = {'Sj
- Document string,documentstring,'''Module do
评论关闭