将图片里面的内容写入f.write 里 以什么样的格式
图片是个矩阵,你可以把矩阵转成str类型写入,比如说
img = [[1,2],[3,4]] with open('test.txt','a') as f: f.write(str(img))