Python基础任务5

1.file a.打开文件方式(读写两种方式) open() 函数 open() 方法用于打开一个文件,并返回文件对象。 写文件:html with open('python.txt', 'w', encoding='utf8') as fp: fp.write(string) 读文件:python f = open('D:/python.txt', 'r') 通常形式为:web open(f
相关文章
相关标签/搜索