Datawhale学习计划:python基础第六期-任务5

1.file a.打开文件方式(读写两种方式) 1)读文件 要以读文件的模式打开一个文件对象,使用Python内置的open()函数,传入文件名和标示符: f = open( '/Users/Esther/test.txt', 'r' ) 如果文件不存在,open()函数会显示错误: Traceback (most recent call last): File "C:/Users/qw/.P
相关文章
相关标签/搜索