立即学习:https://edu.youkuaiyun.com/course/play/26676/379784?utm_source=blogtoedu
一般方法:创建
f=open(text.txt';w'):创建名为text.txt的文件,可以写入
f.write(‘life is short, you need python')
f.close()
文件打开方式:r,w,a,b,+,x等
读csv文档:import csv
本文介绍Python中文件的基本操作,包括创建、写入、关闭及读取CSV文档的方法。通过实例展示如何使用open函数以不同模式打开文件,并进行write操作。同时,介绍了读取CSV文档所需的csv模块。
立即学习:https://edu.youkuaiyun.com/course/play/26676/379784?utm_source=blogtoedu
一般方法:创建
f=open(text.txt';w'):创建名为text.txt的文件,可以写入
f.write(‘life is short, you need python')
f.close()
文件打开方式:r,w,a,b,+,x等
读csv文档:import csv
1977
1万+
11万+

被折叠的 条评论
为什么被折叠?