python基础-文件的读取与写入
写入# 写入文本内容with open('test.txt','w',encoding='utf-8') as file: file.write('要写入的字符串')# 新增追加文本内容with open('test.txt','a') as file: file.write('新增写入内容')# 二进制写入with open('test.jpg','wb') as file: file.write('例二进制图片')读取# 读取文本内容with op