一、Python文件操作 对文件的操作有2种,文本文件、二进制文件(视频、图片等) 1.1open方法基本使用 open(file,mode='r',encoding=None); 几种打开模式 'r' openforreading(default) 'w' openforwriting,truncatingthefilefirst(写模式,如果文件在,先清空【危险】) 'x' createanewfileandopenitforwriting(python3新增,创建模式,如果文件在,会报错) 'a' openforwriting,appendingtotheendofthef...

关注 更多

空空如也 ~ ~

粉丝 更多

空空如也 ~ ~