文件的写入:
with(path.txt, 'w') as f:每次执行这行代码时,会首先清除path.txt中的内容,在写入新的内容。
with open('F:/F/python_code/00.txt', 'w') as f: f.write("d ") f.write("d ") f.write("d ") f.write("d ")
文件的写入:
with(path.txt, 'w') as f:每次执行这行代码时,会首先清除path.txt中的内容,在写入新的内容。
with open('F:/F/python_code/00.txt', 'w') as f: f.write("d ") f.write("d ") f.write("d ") f.write("d ")